CogPMAlignPattern Execute Method Cognex VisionPro 9.22
Run this PMAlign pattern on the given region/image with the given runtime parameters. A results collection will be created and filled with CogPMAlignResult classes in order of decreasing score.

Namespace: Cognex.VisionPro.PMAlign
Assembly: Cognex.VisionPro.PMAlign (in Cognex.VisionPro.PMAlign.dll) Version: 87.0.0.0
Syntax

public CogPMAlignResults Execute(
	ICogImage image,
	ICogRegion searchRegion,
	CogPMAlignRunParams runParams
)

Parameters

image
Type: Cognex.VisionPro ICogImage
The ICogImage in which to search.
searchRegion
Type: Cognex.VisionPro ICogRegion

The optional search region. If you do not specify a search region, the entire image is searched.

runParams
Type: Cognex.VisionPro.PMAlign CogPMAlignRunParams

The CogPMAlignRunParams containing the parameters for this search.

Return Value

Type: CogPMAlignResults

The CogPMAlignResults containing the results of the search.

Exceptions

ExceptionCondition
ArgumentExceptionIf the EdgeThreshold is greater than 255 and the image is CogImage8Grey.
CogSecurityViolationException

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

CogOperatorNoInputImageException

image is NULL.

CogImageNoPixelsException

image is not allocated.

CogOperatorNotTrainedException

This pattern is not trained.

CogOperatorInvalidRegionException

The selected space of the searchRegion is not a valid space of the Image.

CogOperatorInvalidRegionException

searchRegion falls completely outside of image. (Clipping of searchRegion by image is permitted.)

CogPMAlignPatMaxNotTrainedException

The pattern was not trained for PatMax and runParams.RunAlgorithm is PatMax.

CogPMAlignPatQuickNotTrainedException

The PMAlign pattern was not trained for PatQuick and runParams.RunAlgorithm is PatQuick.

CogPMAlignPatFlexNotTrainedException

The PMAlign pattern was not trained for PatFlex and runParams.RunAlgorithm is PatFlex.

CogTimeoutExpiredException

The pattern location took longer than the value you specified for Timeout.

Remarks

When RunMode is SearchImage (the default mode), runs this PMAlign pattern on the given input image or region of interest using the supplied CogPMAlignRunParams. A results collection is created and filled with CogPMAlignResult classes in order of decreasing score.

When RunMode is RefineStartPose, refines the StartPose instead of searching the image.

See Also