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 As Integer, _
ByVal As Integer, _
ByVal As Boolean _
) As GdPictureStatus
public GdPictureStatus FxSubtractBackground(
int ,
int ,
bool
)
public function FxSubtractBackground(
: Integer;
: Integer;
: Boolean
): GdPictureStatus;
public function FxSubtractBackground(
: int,
: int,
: boolean
) : GdPictureStatus;
public: GdPictureStatus FxSubtractBackground(
int ,
int ,
bool
)
public:
GdPictureStatus FxSubtractBackground(
int ,
int ,
bool
)
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);
}
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