CogSearchMaxPattern Train Method Cognex VisionPro 9.8
Trains the pattern.

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

public void Train()
Events

Event TypeReason
ICogChangedEvent Changed

Fires when the pattern object is modified.

The following state flags may be affected:

  • SfTrained
  • SfGetTrainedPatternImage
  • SfGetTrainedPatternImageMask
  • SfGrainLimitCoarse
  • SfGrainLimitFine
Exceptions

ExceptionCondition
ObjectDisposedException Thrown if this CogSearchMaxPattern object has already been disposed.
CogSecurityViolationException Thrown if licensing for this operator cannot be confirmed.
CogOperatorNoTrainImageException Thrown if there is no training image.
CogImageNoPixelsException Thrown if TrainImage is not allocated.
CogImageBadTypeException Thrown if TrainImage is not of type CogImage8Grey, CogImage16Grey, CogImage16Range or CogImage24PlanarColor.
CogOperatorInvalidRegionException Thrown if TrainRegion falls completely outside of TrainImage.
InvalidOperationException Thrown if an internal error occurs during training.
CogTimeoutExpiredException Thrown if the pattern train took longer than the value specified by TrainTimeout.
CogSearchMaxImproperMaskException Thrown if the TrainImageMask is not allocated or contains pixels that have values other than 0 and 255.
NotSupportedException SearchMax does not support non-linear transforms.
CogSearchMaxRegionContainsNoFeaturesException Thrown if the TrainRegion
CogSearchMaxImageTooSmallException Thrown if the TrainImage
Remarks

Trains this CogSearchMaxPattern. If the pattern is already trained then it will be untrained and retrained.
See Also