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

Namespace: Cognex.VisionPro.Caliper
Assembly: Cognex.VisionPro.Caliper (in Cognex.VisionPro.Caliper.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 CogFindCircleTool 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
CogToolNoOperatorException

RunParams is NULL.

CogOperatorNoInputImageException

InputImage is null.

CogImageNoPixelsException

InputImage is not allocated.

CogCaliperNoScorersException

The collection of scoring functions in CaliperRunParams is null or empty or all the scoring functions are disabled and the maximum number of results specified is greater than 0.

CogCaliperBadScorerException

The collection of single-edge scoring functions in CaliperRunParams contains an edge pair scoring function, or the collection of edge-pair scoring functions in CaliperRunParams contains an single-edge scoring function.

CogFindAllCalipersFailedException

All of the calipers failed. This can happen when the values for CaliperSearchLength or CaliperProjectionLength are too small or when all of the specified caliper regions fall completely outside of the input image.

CogFindInvalidExpectedShapeException

The selected space of the ExpectedCircularArc is not a valid space of the input image; the selected space name of the ExpectedCircularArc is a nonqualified space name and more than one instance of it exists in the space tree of the input image; or the selected space name of the ExpectedCircularArc is not a legal space name.

Remarks

Attempts to locate a circle in the supplied InputImage using the specified RunParams. The 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