GdPicture image identifier.
Size of ball rolled under the image. Controlled the amount of subtraction. Value >= 50.
Whether a background is lighter or not than the foreground. Value >= true.
Example





In This Topic
GdPicture14 Namespace / GdPictureImaging Class / FxSubtractBackground Method

FxSubtractBackground Method (GdPictureImaging)

In This Topic
Performs a Subtract Background (RollingBall) algorithm. It mainly is used for Medical Images like images of cells. The two parameters in the algorithm give you control over the size of the subtraction and the color of it. For more information please revise Stanley Sternberg's, “Biomedical Image Processing”, IEEE Computer, January 1983.
Syntax
'Declaration
 
Public Function FxSubtractBackground( _
   ByVal ImageID As Integer, _
   ByVal RollingBallSize As Integer, _
   ByVal LightBackground As Boolean _
) As GdPictureStatus
public GdPictureStatus FxSubtractBackground( 
   int ImageID,
   int RollingBallSize,
   bool LightBackground
)
public function FxSubtractBackground( 
    ImageID: Integer;
    RollingBallSize: Integer;
    LightBackground: Boolean
): GdPictureStatus; 
public function FxSubtractBackground( 
   ImageID : int,
   RollingBallSize : int,
   LightBackground : boolean
) : GdPictureStatus;
public: GdPictureStatus FxSubtractBackground( 
   int ImageID,
   int RollingBallSize,
   bool LightBackground
) 
public:
GdPictureStatus FxSubtractBackground( 
   int ImageID,
   int RollingBallSize,
   bool LightBackground
) 

Parameters

ImageID
GdPicture image identifier.
RollingBallSize
Size of ball rolled under the image. Controlled the amount of subtraction. Value >= 50.
LightBackground
Whether a background is lighter or not than the foreground. Value >= true.

Return Value

A member of the GdPictureStatus enumeration.
Example
Subtracting background from a jpeg image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // LoadInMemory parameter is set to true in order to be able to update the input file.
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg", true);
 
    // Subtracting a background (RollingBall).
    gdpictureImaging.FxSubtractBackground(imageID, 10, false);
    gdpictureImaging.SaveAsPNG(imageID, "image.png");
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also