CogCNLSearchTool Run Method Cognex VisionPro
Runs the tool using the current parameter settings.

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

public override void Run()

Implements

ICogTool Run 
Events

Event TypeReason
ICogTool Running

Fires before the tool runs.

ICogChangedEvent Changed

Fires when the tool runs. If the run was successful, results are generated; if the run was not successful, no results are generated and the previous results are cleared. Use RunStatus after CogCNLSearchTool returns or in a event handler to determine whether a run was successful or unsuccessful.

The following state flags may be affected:

ICogTool Ran

Fires after the tool runs.

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

SearchRegion does not fall completely within InputImage and the region mode specified in RunParams is not AffineTransform. 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.

CogToolNoOperatorException

Pattern is null.

Remarks

Attempts to locate the trained Pattern in the InputImage using the current RunParams. Results are placed in Results.

Note: This method does not actually raise the exceptions listed below. Use the RunStatus property to obtain a ICogRunStatus reference. Then use its Exception property to see if the Run method raised any exceptions.

See Also