imaqDetectRectangles

NI Vision for LabWindows/CVI Function

imaqDetectRectangles

Usage

RectangleMatch* imaqDetectRectangles(const Image* image, const RectangleDescriptor* rectangleDescriptor, const CurveOptions* curveOptions, const ShapeDetectionOptions* shapeDetectionOptions, const ROI* roi, int* numMatchesReturned);

Purpose

Searches for rectangles in an image.

Image Types Supported

IMAQ_IMAGE_U8

Parameters

Name

Type

Description

image const Image* The image on which to detect rectangles.
rectangleDescriptor const RectangleDescriptor* A structure that describes the rectangles to search for in the image. This parameter is required and cannot be NULL.
curveOptions const CurveOptions* Describes how the function identifies the curves in the image. This function does not support identifying curves with subpixel accuracy and therefore ignores the subpixelAccuracy element of this parameter.
shapeDetectionOptions const ShapeDetectionOptions* The options to use when detecting rectangles.
roi const ROI* The region of interest applied to the image that specifies where rectangles can be detected. Set this parameter to NULL to search the entire image.
numMatchesReturned int* On return, the number of rectangles that the function matched. Set this parameter to NULL if you do not wish to return information about the number of matched rectangles.

Return Value

Type

Description

RectangleMatch* On success, this function returns an array of information about each match found. On failure, this function returns NULL. To get extended error information, call imaqGetLastError(). When you are finished with the return value, dispose of the pointer by calling imaqDispose().

Parameter Discussion

curveOptions—Set curveOptions to NULL to use the default curve options, as follows:

extractionMode IMAQ_NORMAL_IMAGE
threshold 75
filterSize IMAQ_NORMAL
minLength 25
rowStepSize 15
columnStepSize 15
maxEndPointGap 10
onlyClosed FALSE
subpixelAccuracy FALSE

shapeDetectionOptions—Set shapeDetectionOptions to NULL to use the default shape detection options, as follows:

mode IMAQ_GEOMETRIC_MATCH_SHIFT_INVARIANT
orientationRanges NULL
numOrientationRanges 0
scaleRange {75, 125}
minMatchScore 800