Cog3DPatMaxPattern Train Method Cognex VisionPro 9.21
Trains this 3DPatMax pattern. If the pattern is already trained then it is untrained and retrained.

Namespace: Cognex.VisionPro3D
Assembly: Cognex.VisionPro3D (in Cognex.VisionPro3D.dll) Version: 83.0.0.0
Syntax

public void Train()
Events

Event TypeReason
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 a new subsampling cube size. This can only happen when GranularityAutoSelect is "true". The following state flags may be affected:
Exceptions

ExceptionCondition
CogSecurityViolationException Licensing for this operation cannot be confirmed. See Understanding VisionPro Security for more information.
CogOperatorNoTrainImageException The TrainVisionData is null.
ArgumentOutOfRangeException The TrainVisionData you supplied is not a valid source of 3D vision data.

3D vision data can be stored in a single CogImage16Range or stored in a CogVisionDataContainer as a matched pair, with one CogImage16Range holding the 3D data and one CogImage16Grey holding corresponding grey-level information or stored in a Cog3DPointCloudMesh. Either style of input is acceptable. All objects are referred to by the term "vision data" and all support the ICogVisionData interface.

InvalidOperationException The TrainRegion contains too few 3D points to allow training. This might occur because the region falls completely outside of the TrainVisionData, Or has an invalid SelectedSpaceName3D.
CogTimeoutExpiredException The pattern training took longer than the enabled TrainTimeout value.
Remarks

A 3DPatMax pattern must be trained before it can be used to search for pattern instances. The trained pattern holds information needed for fast searching at runtime.
See Also