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

Namespace: Cognex.VisionPro.ImageProcessing
Assembly: Cognex.VisionPro.ImageProcessing (in Cognex.VisionPro.ImageProcessing.dll) Version: 91.0.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 CogHistogramTool returns or in a Ran 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
CogOperatorNoInputImageException

InputImage is NULL.

CogImageNoPixelsException

InputImage is not allocated.

CogOperatorInvalidRegionException

The selected space of one of the regions is not a valid space of the corresponding input image.

ArgumentException

RegionMode is not AffineTransform or PixelAlignedBoundingBox.

OutOfMemoryException

Could not allocate memory for the histogram.

CogToolNoOperatorException

RunParams is NULL.

Remarks

Generates a histogram for the InputImage using the supplied RunParams. You can specify that the histogram be limited to part of the input image by supplying a value for the Region property.

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