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

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

public CogCNLSearchResults Execute(
	CogImage8Grey inputImage,
	ICogRegion searchRegion,
	CogCNLSearchRunParams runParams
)

Return Value

Type: CogCNLSearchResults

A CogCNLSearchResults results collection, sorted in order of decreasing score, containing the results of the search.

Exceptions

ExceptionCondition
CogSecurityViolationException

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

CogOperatorNoInputImageException

inputImage is NULL.

CogImageNoPixelsException

inputImage is not allocated.

CogOperatorNotTrainedException

This object has not been Train .

CogCNLSearchAlgorithmNotTrainedException

This object has not been trained for the algorithm specified in runParams.

CogCNLSearchAccuracyNotTrainedException

This object has not been trained for the accuracy specified in runParams.

CogOperatorInvalidRegionException

The selected space of searchRegion is not a valid space in inputImage.

CogOperatorInvalidRegionException

The searchRegion lies completely outside of inputImage.

CogOperatorInvalidRegionException

The region mode specified in runParams is AffineTransform but the searchRegion does not fall completely within inputImage Note that if the searchRegion falls within 2 or 3 pixels of any edge of inputImage, then this error will occur.

CogOperatorInvalidRegionException

The region mode specified in runParams is AffineTransform but searchRegion is not of type CogRectangleAffine.

ArgumentException

runParams is NULL.

CogCNLSearchTooSmallToSearchException

inputImage or the region mode specified in runParams is too small to contain the pattern. Note that this error condition may be thrown in cases where a partially matched pattern could fit within the image or region.

CogCNLSearchInvalidSearchPointException

The supplied starting point for a point search would place the pattern outside of inputImage. Note that this error will properly consider any specified partial-match parameters.

Remarks

Run this CNLSearch pattern on the supplied input image and search region using the supplied CogCNLSearchRunParams. A CogCNLSearchResults will be created and filled with CogCNLSearchResult classes in order of decreasing score.

If you have specified a point search, then this function returns a single result object, even if the score for the search is zero.

If an error occurs, then a NULL result object is returned.

See Also