CogBlobSegmentationParams SetSegmentationSubtractionImage Method ( Byte , CogImage8Grey,  Byte , Int32, Int32, Int32)Cognex VisionPro
Sets the segmentation Mode to SubtractionImage and sets the PreMap, SubtractionImage, PostMap, ScalingValue, SubtractionImageOffsetX, & SubtractionImageOffsetY properties to the values supplied.

Namespace: Cognex.VisionPro.Blob
Assembly: Cognex.VisionPro.Blob (in Cognex.VisionPro.Blob.dll) Version: 65.1.0.0
Syntax

public void SetSegmentationSubtractionImage(
	byte[] preMap,
	CogImage8Grey subtractionImage,
	byte[] postMap,
	int scalingValue,
	int subtractionImageOffsetX,
	int subtractionImageOffsetY
)

Parameters

preMap
Type:  System Byte 
Pixel map that is to be applied to the input image before subtracting the subtraction image. Each pixel in the input image is used as an index into the supplied map. The input pixel value is replaced with the value from the map.
subtractionImage
Type: Cognex.VisionPro CogImage8Grey
The subtraction image. The pixels in this image are subtracted from those in the input image to produce the segmented image.
postMap
Type:  System Byte 
Pixel map that is to be applied to the image that resulted from subtracting the subtraction image from the input image. Each pixel in the subtracted image is used as an index into the supplied map. The input pixel value is replaced with the value from the map.
scalingValue
Type: System Int32
Pixel value that represents a blob weight of 1.0, all other pixel values are interpreted on a linear scale relative to this value.
subtractionImageOffsetX
Type: System Int32
The X offset value in pixels of the subtractionImage. The X and Y offset values measure the offset from the upper-left corner of the run-time input image to the upper-left corner of the subtractionImage in image coordinates of the input image.
subtractionImageOffsetY
Type: System Int32
The Y offset value in pixels of the subtractionImage. The X and Y offset values measure the offset from the upper-left corner of the run-time input image to the upper-left corner of the subtractionImage in image coordinates of the input image.
Exceptions

ExceptionCondition
ArgumentExceptionscalingValue is less than 0 or greater than 255.
ArgumentExceptionpreMap or postMap is NULL or is not a 1-dimensional array with a size of 256.
ArgumentExceptionsubtractionImage is NULL or unallocated.
Remarks

Sets the segmentation Mode to SubtractionImage and sets TailLow, SetPreMap( Byte ), SubtractionImage, SetPostMap( Byte ), Softness, ScalingValue, SubtractionImageOffsetX, and SubtractionImageOffsetY to the values supplied.

This function suspends event delivery, then sets the public properties of CogBlobSegmentationParams with the supplied values. A single event that includes all of the affected functional area is typically generated.

See Also