Click or drag to resize

IMcBackgroundSub Method

Corrects for uneven background lighting in an image using image subtraction between an image and an associated background image.

Namespace:  MediaCy.IQL.Operations
Assembly:  MediaCy.IQL.Operations (in MediaCy.IQL.Operations.dll) Version: 10.0.6912.0
Syntax
VB
Function Sub ( 
	vBackground As Object,
	<OptionalAttribute> vSourceImg As Object
) As McImage

Parameters

vBackground
Type: SystemObject
Image (or IMcRegionAccess) of the background. If the background image is supplied as an IMcRegionAccess or if the background image has UseActiveFrameRange set to FALSE, then the one supplied frame is reused to associate with each frame of the image. Otherwise each background source frame is associated with a destination frame until one of the ActiveFrameRange's is exhausted.
vSourceImg (Optional)
Type: SystemObject
Optional source image, operator applies to parent image when parameter is omitted.

Return Value

Type: McImage
The resulting McImage
Remarks
A conversion is performed on the background image so that it has the same type as the source image. The conversion rules are defined by the value of the Conversion property. The background image is the image of the background lighting. An example is the image taken with a camera mounted on a microscope when the slide to be analyzed is removed. It is assumed to have the same lighting conditions as the image to be corrected. For color images, the above formula is applied to each color channel of the image separately; i.e., subtraction is not performed on the intensity of the combined RGB value. The background subtraction algorithm is based on the following formula: CI(x,y) = I(x,y) - BI(x,y) + M where: @untitled table I(x,y) is a pixel value of the original image at location (x,y) BI(x,y) is a pixel value of the background image at the same location M is the average pixel value of the background image CI(x,y) is the new pixel value in the corrected image. This function relies on image subtraction, and therefore should not be used when accurate optical density measurements on the corrected image are needed. It is used primarily to flatten the background of an image prior to counting or measuring objects.
See Also