Trains this PMRedLine pattern. If the pattern is already trained then
it will be untrained and retrained.
Namespace: Cognex.VisionPro.PMRedLineAssembly: Cognex.VisionPro.PMRedLine (in Cognex.VisionPro.PMRedLine.dll) Version: 79.0.0.0
Syntax
Events
| Event Type | Reason |
|---|---|
| ICogChangedEvent Changed | Fires when this method changes the Trained state of the pattern. The following state flags may be affected: |
| ICogChangedEvent Changed | Fires when this method trains the pattern successfully and also computes new granularity limits. The following state flags may be affected: |
Exceptions
| Exception | Condition |
|---|---|
| CogSecurityViolationException | Licensing for this operation cannot be confirmed. See Understanding VisionPro Security for more information. |
| CogOperatorNoTrainImageException | The TrainImage is null. |
| CogImageNoPixelsException | The TrainImage has no allocated pixels. |
| CogImageBadTypeException | The TrainImage you supplied is not a CogImage8Grey. |
| CogOperatorInvalidRegionException | The TrainRegion falls completely outside of the TrainImage. Or has an invalid SelectedSpaceName. |
| CogTimeoutExpiredException | The pattern training took longer than the enabled TrainTimeout value. |
Remarks
Once your pattern is trained you can search for instances of the pattern in a runtime input image. You can do this in one of two ways:
- You can call the Execute(ICogImage, ICogRegion, CogPMRedLineRunParams) method of this class, or
- You can call the Run method of a CogPMRedLineTool class that contains this pattern object.
See Also