CogSearchMaxPattern TrainImageMask Property Cognex VisionPro 9.10
Gets or sets the mask that is used when training the CogSearchMaxPattern. The mask allows the user to identify areas of the TrainImage as "Care" (0) or "Don't Care" (255). The mask is aligned to the TrainImage using the TrainImageMaskOffsetX and TrainImageMaskOffsetY values.

Namespace: Cognex.VisionPro.SearchMax
Assembly: Cognex.VisionPro.SearchMax (in Cognex.VisionPro.SearchMax.dll) Version: 79.0.0.0
Syntax

public CogImage8Grey TrainImageMask { get; set; }

Property Value

Type: CogImage8Grey
The mask for the TrainImage. Default value is NULL.
Events

Event TypeReason
ICogChangedEvent Changed

Fires when this property changes.

The following state flags may be affected:

  • SfTrainImageMask
  • SfTrained
  • SfGetTrainedPatternImage
  • SfGetTrainedPatternImageMask
Exceptions

ExceptionCondition
ObjectDisposedException Thrown if this CogSearchMaxPattern object has already been disposed.
InvalidOperationException Thrown when you attempt to set this to an unallocated image or to an image with pixel values other than 0 or 255.
Remarks

A mask is a CogImage8Grey that excludes specified parts of the run-time image. Areas within pixels in the TrainImage that correspond to pixels in the mask image that have a value of 0 ("don't care pixels") are ignored; mask pixels with values 255 are care pixels (areas within TrainImage pixels that correspond to care pixels are considered).

Note Changing this property causes this CogSearchMaxPattern to become untrained.

See Also