CogCNLSearchPattern Train Method Cognex VisionPro 9.7
Trains this CNLSearch pattern. If the pattern is already trained then it will be untrained and retrained.

Namespace: Cognex.VisionPro.CNLSearch
Assembly: Cognex.VisionPro.CNLSearch (in Cognex.VisionPro.CNLSearch.dll) Version: 73.0.0.0
Syntax

public void Train()
Events

Exceptions

ExceptionCondition
CogSecurityViolationException

Security is not enabled for this vision tool. See Resolving Security-Related Error Messages for more information.

CogOperatorNoTrainImageException

TrainImage is NULL.

CogImageNoPixelsException

TrainImage is not allocated.

CogOperatorInvalidRegionException

The selected space of the TrainRegion is not a valid space of the TrainImage.

CogOperatorInvalidRegionException

TrainRegion lies completely outside of TrainImage. (Clipping of the train region by the input image is permitted, except when the TrainRegionMode is AffineTransform. In that case, the input region must line completely within the image. This error may be thrown if the input region is within a few pixels of the edge of the image.)

CogOperatorInvalidRegionException

TrainRegionMode is AffineTransform but TrainRegion is not of type CogRectangleAffine.

CogCNLSearchTooSmallToTrainException

Either the TrainRegion or the TrainImage is too small to train. The minimum trainable image size is 8x8 pixels.

CogCNLSearchCanNotTrainException

TrainImage does not contain a trainable image (not enough features).

Remarks

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

The pattern is trained for the Algorithms and Accuracies specified in this object. Keep in mind that only the trained algorithms and accuracies can be used at run time.

See Also