CogShapeExtract Execute Method Cognex VisionPro 9.8
Execute will extract contours from the input image and convert each contour into a shape model which describes the geometry of the contour as well as its polarity. A filtered and ranked collection of shape models is returned.

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 75.1.0.0
Syntax

public ICogShapeModelCollection Execute(
	ICogImage inputImage,
	ICogRegion extractRegion
)

Parameters

inputImage
Type: Cognex.VisionPro ICogImage

The image from which to extract shapes.

extractRegion
Type: Cognex.VisionPro ICogRegion

The region of inputImage from which to extract shapes. If no region is supplied, the entire image is used.

Return Value

Type: ICogShapeModelCollection

The returned shape models.

Exceptions

ExceptionCondition
ArgumentException

A NULL shape model was supplied.

CogOperatorNoInputImageException

inputImage is NULL

CogImageNoPixelsException

inputImage is not allocated.

CogShapeExtractNoProximityShapeException

RankMode is Proximity but ProximityShape is Nothing.

CogShapeExtractNoOpenShapesException

Closure is set to either Open or DontCare but Vocabulary specifies no open shapes.

CogImageBadSelectedSpaceNameException

The selected space of the inputImage is not a valid space of the inputImage's coordinate space tree; inputImage's selected space is nonqualified and more than one instance of it exists in inputImage's space tree; or inputImage's selected space is not a legal space name.

CogOperatorInvalidShapeException

RankMode is Proximity and ProximityShape's selected space is not a valid space in inputImage; ProximityShape's selected space is nonqualified and more than one instance of it exists in inputImage's coordinate space tree; or ProximityShape's selected space is not a legal space name.

CogOperatorInvalidRegionException

extractRegion's selected space is not a valid space in inputImage's coordinate space tree; extractRegion's selected space is nonqualified and more than once instance of it appears in inputImage's coordinate space tree; extractRegion's selected space is not a legal space name; or extractRegion falls completely outside of inputImage.

Remarks

Execute will extract contours from the input image and convert each contour into a shape model which describes the geometry of the contour as well as its polarity. A filtered and ranked collection of shape models is returned.

Note: Each shape model within the collection will have its selected space set to the fully-qualified name of inputImage's selected space.

See Also