IMAQ Detect Shapes VI

NI Vision 2017 for LabVIEW Help

Edition Date: May 2017

Part Number: 370281AD-01

»View Product Info
Download Help (Windows Only)
Owning Palette: Searching and Matching
Requires: NI Vision Development Module

Searches for rectangles, lines, ellipses, or circles in an image.

Use the pull-down menu to select an instance of this VI.

IMAQ Detect Circles

Searches for circles in an image.

Supported Image Types

8-bit unsigned grayscale

IMAQ Detect Circles

/images/reference/en-XX/help/370281AD-01/ccclst.gif

ROI Descriptor is the descriptor that defines the rectangle or rotated rectangle within which to detect shapes.

/images/reference/en-XX/help/370281AD-01/c1di32.gif

Global Rectangle contains the coordinates of the bounding rectangle.

/images/reference/en-XX/help/370281AD-01/c1dcclst.gif

Contours are each of the individual shapes that define an ROI.

/images/reference/en-XX/help/370281AD-01/cenum.gif

ID refers to whether the contour is the external or internal edge of an ROI.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Type is the shape type of the contour.

/images/reference/en-XX/help/370281AD-01/c1di32.gif

Coordinates indicates the relative position of the contour.

/images/reference/en-XX/help/370281AD-01/cgenclasstagrefflat.gif

Image is a reference to the image in which you want to search.

/images/reference/en-XX/help/370281AD-01/cnclst.gif

Circle Descriptor specifies the sizes of circles to detect.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Min Radius specifies the minimum radius describing the circles to detect.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Max Radius specifies the maximum radius describing the circles to detect.

/images/reference/en-XX/help/370281AD-01/ccclst.gif

Match Options are the match options used when detecting shapes.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Rotation specifies whether or not to search for rotated versions of the shape.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Scale specifies whether or not to search for scaled versions of the shape.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Occlusion specifies whether or not to search for occluded versions of the shape.

/images/reference/en-XX/help/370281AD-01/c1dnclst.gif

Range Settings is an array that specifies the allowable ranges for rotation and scale.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Match Constraints specifies the match option whose values you want to constrain by the given range. The following options are available:

Rotation Angle (degrees) (0)

Set a range for this option to specify the angles at which you expect the VI to find template matches in the inspection image. The VI ignores this range if the Rotation is not enabled.

Scale Factor (%) (1)

Set a range for this option to specify the sizes at which you expect the VI to find template matches in the inspection image. The size is expressed as the following percentage: the size of the match divided by size of the template image, multiplied by 100. The VI ignores this range if the Scale is not enabled.

Occlusion (%) (2)

Set a range for this option to specify the amount of occlusion you expect for a match in the inspection image. NI Vision can accurately detect matches that have up to 50% occlusion. The VI ignores this range if the Occlusion is not enabled.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Min is the minimum value of the range for a given Match Constraint.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Max is the maximum value of the range for a given Match Constraint.

/images/reference/en-XX/help/370281AD-01/cerrcodeclst.gif

error in (no error) describes the error status before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.

/images/reference/en-XX/help/370281AD-01/cbool.gif

status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.

/images/reference/en-XX/help/370281AD-01/ci32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

/images/reference/en-XX/help/370281AD-01/cstr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

/images/reference/en-XX/help/370281AD-01/ccclst.gif

Curve Parameters contains information about how curves are extracted from the inspection image during the match phase.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Extraction Mode specifies how the VI identifies curves in the image. Choose from the following options:

Normal (0)

(Default) Select Normal if you want the VI to make no assumptions about the uniformity of objects in the image or the image background.

Uniform Regions (1)

Select Uniform Regions if you want the VI to assume that either the objects in the image or the image background consist of uniform pixel values. This allows the VI to more accurately calculate the external curves of the objects.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Edge Threshold specifies the minimum contrast a seed point must have for it to begin a curve. Valid values range from 1 to 255. The default value is 75.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Edge Filter Size specifies the width of the edge filter that the VI uses to identify curves in the image. The following options are available:

Fine (0)

Sets the Edge Filter Size to fine.

Normal (1)

(Default) Sets the Edge Filter Size to normal.

Contour Tracing (2)

Sets the Edge Filter Size to contour tracing, which provides the best results for contour extraction but increases the time required to process the image.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Min Length specifies the length, in pixels, of the smallest curve that you want the VI to identify. The VI ignores any curves that have a length less than this value. The default value is 25.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Row Search Step Size specifies the distance, in the y direction, between the image rows that the algorithm inspects for curve seed points. Valid values range from 1 to 255. The default value is 15.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Col Search Step Size specifies the distance, in the x direction, between the image columns that the algorithm inspects for curve seed points. Valid values range from 1 to 255. The default value is 15.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Max Endpoint Gap specifies the maximum gap, in pixels, between the endpoints of a curve that the VI identifies as a closed curve. If the gap is larger than this value, the VI identifies the curve as an open curve. The default value is 10.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Closed specifies whether to identify only closed curves in the image. The default value is FALSE, which specifies that the VI should identify both open and closed curves.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Subpixel specifies whether to detect curve points with subpixel accuracy. The default is FALSE.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Minimum match score is the minimum score a returned shape can have.

/images/reference/en-XX/help/370281AD-01/i1dcclst.gif

Circles is an array of circle clusters that describe each found circle.

/images/reference/en-XX/help/370281AD-01/inclst.gif

Position is the coordinates of the found circle center.

/images/reference/en-XX/help/370281AD-01/idbl.gif

Radius is the radius of the found circle.

/images/reference/en-XX/help/370281AD-01/idbl.gif

Score is the score of the found circle. Values range from 0 to 1000, where 1000 represents a perfect match.

/images/reference/en-XX/help/370281AD-01/ii32.gif

Number of Matches Returned is the number of matches found.

/images/reference/en-XX/help/370281AD-01/ierrcodeclst.gif

error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out indicator on the front panel and select Explain Error from the shortcut menu for more information about the error.

/images/reference/en-XX/help/370281AD-01/ibool.gif

status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.

/images/reference/en-XX/help/370281AD-01/ii32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

/images/reference/en-XX/help/370281AD-01/istr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

IMAQ Detect Ellipses

Searches for ellipses in an image.

Supported Image Types

8-bit unsigned grayscale

IMAQ Detect Ellipses

/images/reference/en-XX/help/370281AD-01/ccclst.gif

ROI Descriptor is the descriptor that defines the rectangle or rotated rectangle within which to detect shapes.

/images/reference/en-XX/help/370281AD-01/c1di32.gif

Global Rectangle contains the coordinates of the bounding rectangle.

/images/reference/en-XX/help/370281AD-01/c1dcclst.gif

Contours are each of the individual shapes that define an ROI.

/images/reference/en-XX/help/370281AD-01/cenum.gif

ID refers to whether the contour is the external or internal edge of an ROI.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Type is the shape type of the contour.

/images/reference/en-XX/help/370281AD-01/c1di32.gif

Coordinates indicates the relative position of the contour.

/images/reference/en-XX/help/370281AD-01/cgenclasstagrefflat.gif

Image is a reference to the image in which you want to search.

/images/reference/en-XX/help/370281AD-01/cnclst.gif

Ellipse Descriptor specifies the sizes of ellipses to detect.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Min Major Radius specifies the minimum length of the semi-major axis describing the ellipses to detect.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Max Major Radius specifies the maximum length of the semi-major axis describing the ellipses to detect.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Min Minor Radius specifies the minimum length of the semi-minor axis describing the ellipses to detect.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Max Minor Radius specifies the maximum length of the semi-minor axis describing the ellipses to detect.

/images/reference/en-XX/help/370281AD-01/ccclst.gif

Match Options are the match options used when detecting shapes.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Rotation specifies whether or not to search for rotated versions of the shape.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Scale specifies whether or not to search for scaled versions of the shape.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Occlusion specifies whether or not to search for occluded versions of the shape.

/images/reference/en-XX/help/370281AD-01/c1dnclst.gif

Range Settings is an array that specifies the allowable ranges for rotation and scale.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Match Constraints specifies the match option whose values you want to constrain by the given range. The following options are available:

Rotation Angle (degrees) (0)

Set a range for this option to specify the angles at which you expect the VI to find template matches in the inspection image. The VI ignores this range if the Rotation is not enabled.

Scale Factor (%) (1)

Set a range for this option to specify the sizes at which you expect the VI to find template matches in the inspection image. The size is expressed as the following percentage: the size of the match divided by size of the template image, multiplied by 100. The VI ignores this range if the Scale is not enabled.

Occlusion (%) (2)

Set a range for this option to specify the amount of occlusion you expect for a match in the inspection image. NI Vision can accurately detect matches that have up to 50% occlusion. The VI ignores this range if the Occlusion is not enabled.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Min is the minimum value of the range for a given Match Constraint.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Max is the maximum value of the range for a given Match Constraint.

/images/reference/en-XX/help/370281AD-01/cerrcodeclst.gif

error in (no error) describes the error status before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.

/images/reference/en-XX/help/370281AD-01/cbool.gif

status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.

/images/reference/en-XX/help/370281AD-01/ci32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

/images/reference/en-XX/help/370281AD-01/cstr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

/images/reference/en-XX/help/370281AD-01/ccclst.gif

Curve Parameters contains information about how curves are extracted from the inspection image during the match phase.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Extraction Mode specifies how the VI identifies curves in the image. Choose from the following options:

Normal (0)

(Default) Select Normal if you want the VI to make no assumptions about the uniformity of objects in the image or the image background.

Uniform Regions (1)

Select Uniform Regions if you want the VI to assume that either the objects in the image or the image background consist of uniform pixel values. This allows the VI to more accurately calculate the external curves of the objects.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Edge Threshold specifies the minimum contrast a seed point must have for it to begin a curve. Valid values range from 1 to 255. The default value is 75.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Edge Filter Size specifies the width of the edge filter that the VI uses to identify curves in the image. The following options are available:

Fine (0)

Sets the Edge Filter Size to fine.

Normal (1)

(Default) Sets the Edge Filter Size to normal.

Contour Tracing (2)

Sets the Edge Filter Size to contour tracing, which provides the best results for contour extraction but increases the time required to process the image.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Min Length specifies the length, in pixels, of the smallest curve that you want the VI to identify. The VI ignores any curves that have a length less than this value. The default value is 25.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Row Search Step Size specifies the distance, in the y direction, between the image rows that the algorithm inspects for curve seed points. Valid values range from 1 to 255. The default value is 15.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Col Search Step Size specifies the distance, in the x direction, between the image columns that the algorithm inspects for curve seed points. Valid values range from 1 to 255. The default value is 15.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Max Endpoint Gap specifies the maximum gap, in pixels, between the endpoints of a curve that the VI identifies as a closed curve. If the gap is larger than this value, the VI identifies the curve as an open curve. The default value is 10.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Closed specifies whether to identify only closed curves in the image. The default value is FALSE, which specifies that the VI should identify both open and closed curves.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Subpixel specifies whether to detect curve points with subpixel accuracy. The default is FALSE.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Minimum match score is the minimum score a returned shape can have.

/images/reference/en-XX/help/370281AD-01/i1dcclst.gif

Ellipses is an array of ellipse clusters that describe each found ellipse.

/images/reference/en-XX/help/370281AD-01/inclst.gif

Position are the coordinates of the found ellipse center.

/images/reference/en-XX/help/370281AD-01/idbl.gif

Angle is the orientation of the major axis with respect to the horizontal.

/images/reference/en-XX/help/370281AD-01/idbl.gif

Major Radius is the length of the semi-major axis.

/images/reference/en-XX/help/370281AD-01/idbl.gif

Minor Radius is the length of the semi-minor axis.

/images/reference/en-XX/help/370281AD-01/idbl.gif

Score is the score of the found ellipse. Values range from 0 to 1000, where 1000 represents a perfect match.

/images/reference/en-XX/help/370281AD-01/ii32.gif

Number of Matches Returned is the number of matches found.

/images/reference/en-XX/help/370281AD-01/ierrcodeclst.gif

error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out indicator on the front panel and select Explain Error from the shortcut menu for more information about the error.

/images/reference/en-XX/help/370281AD-01/ibool.gif

status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.

/images/reference/en-XX/help/370281AD-01/ii32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

/images/reference/en-XX/help/370281AD-01/istr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

IMAQ Detect Lines

Searches for lines in an image.

Supported Image Types

8-bit unsigned grayscale

IMAQ Detect Lines

/images/reference/en-XX/help/370281AD-01/ccclst.gif

ROI Descriptor is the descriptor that defines the rectangle or rotated rectangle within which to detect shapes.

/images/reference/en-XX/help/370281AD-01/c1di32.gif

Global Rectangle contains the coordinates of the bounding rectangle.

/images/reference/en-XX/help/370281AD-01/c1dcclst.gif

Contours are each of the individual shapes that define an ROI.

/images/reference/en-XX/help/370281AD-01/cenum.gif

ID refers to whether the contour is the external or internal edge of an ROI.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Type is the shape type of the contour.

/images/reference/en-XX/help/370281AD-01/c1di32.gif

Coordinates indicates the relative position of the contour.

/images/reference/en-XX/help/370281AD-01/cgenclasstagrefflat.gif

Image is a reference to the image in which you want to search.

/images/reference/en-XX/help/370281AD-01/cnclst.gif

Line Descriptor specifies the lengths of lines to detect.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Min Length specifies the minimum length of the described line.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Max Length specifies maximum length of the described line.

/images/reference/en-XX/help/370281AD-01/ccclst.gif

Match Options are the match options used when detecting shapes.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Rotation specifies whether or not to search for rotated versions of the shape.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Scale specifies whether or not to search for scaled versions of the shape.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Occlusion specifies whether or not to search for occluded versions of the shape.

/images/reference/en-XX/help/370281AD-01/c1dnclst.gif

Range Settings is an array that specifies the allowable ranges for rotation and scale.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Match Constraints specifies the match option whose values you want to constrain by the given range. The following options are available:

Rotation Angle (degrees) (0)

Set a range for this option to specify the angles at which you expect the VI to find template matches in the inspection image. The VI ignores this range if the Rotation is not enabled.

Scale Factor (%) (1)

Set a range for this option to specify the sizes at which you expect the VI to find template matches in the inspection image. The size is expressed as the following percentage: the size of the match divided by size of the template image, multiplied by 100. The VI ignores this range if the Scale is not enabled.

Occlusion (%) (2)

Set a range for this option to specify the amount of occlusion you expect for a match in the inspection image. NI Vision can accurately detect matches that have up to 50% occlusion. The VI ignores this range if the Occlusion is not enabled.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Min is the minimum value of the range for a given Match Constraint.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Max is the maximum value of the range for a given Match Constraint.

/images/reference/en-XX/help/370281AD-01/cerrcodeclst.gif

error in (no error) describes the error status before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.

/images/reference/en-XX/help/370281AD-01/cbool.gif

status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.

/images/reference/en-XX/help/370281AD-01/ci32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

/images/reference/en-XX/help/370281AD-01/cstr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

/images/reference/en-XX/help/370281AD-01/ccclst.gif

Curve Parameters contains information about how curves are extracted from the inspection image during the match phase.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Extraction Mode specifies how the VI identifies curves in the image. Choose from the following options:

Normal (0)

(Default) Select Normal if you want the VI to make no assumptions about the uniformity of objects in the image or the image background.

Uniform Regions (1)

Select Uniform Regions if you want the VI to assume that either the objects in the image or the image background consist of uniform pixel values. This allows the VI to more accurately calculate the external curves of the objects.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Edge Threshold specifies the minimum contrast a seed point must have for it to begin a curve. Valid values range from 1 to 255. The default value is 75.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Edge Filter Size specifies the width of the edge filter that the VI uses to identify curves in the image. The following options are available:

Fine (0)

Sets the Edge Filter Size to fine.

Normal (1)

(Default) Sets the Edge Filter Size to normal.

Contour Tracing (2)

Sets the Edge Filter Size to contour tracing, which provides the best results for contour extraction but increases the time required to process the image.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Min Length specifies the length, in pixels, of the smallest curve that you want the VI to identify. The VI ignores any curves that have a length less than this value. The default value is 25.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Row Search Step Size specifies the distance, in the y direction, between the image rows that the algorithm inspects for curve seed points. Valid values range from 1 to 255. The default value is 15.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Col Search Step Size specifies the distance, in the x direction, between the image columns that the algorithm inspects for curve seed points. Valid values range from 1 to 255. The default value is 15.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Max Endpoint Gap specifies the maximum gap, in pixels, between the endpoints of a curve that the VI identifies as a closed curve. If the gap is larger than this value, the VI identifies the curve as an open curve. The default value is 10.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Closed specifies whether to identify only closed curves in the image. The default value is FALSE, which specifies that the VI should identify both open and closed curves.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Subpixel specifies whether to detect curve points with subpixel accuracy. The default is FALSE.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Minimum match score is the minimum score a returned shape can have.

/images/reference/en-XX/help/370281AD-01/i1dcclst.gif

Lines is an array of line clusters that describe each found line.

/images/reference/en-XX/help/370281AD-01/inclst.gif

Start Point The starting point of the line.

/images/reference/en-XX/help/370281AD-01/inclst.gif

End Point The ending point of the line.

/images/reference/en-XX/help/370281AD-01/idbl.gif

Length The length of the line measured in pixels from the start point to the end point.

/images/reference/en-XX/help/370281AD-01/idbl.gif

Angle The orientation of the line with respect to the horizontal.

/images/reference/en-XX/help/370281AD-01/idbl.gif

Score is the score of the found line. Values range from 0 to 1000, where 1000 represents a perfect match.

/images/reference/en-XX/help/370281AD-01/ii32.gif

Number of Matches Returned is the number of matches found.

/images/reference/en-XX/help/370281AD-01/ierrcodeclst.gif

error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out indicator on the front panel and select Explain Error from the shortcut menu for more information about the error.

/images/reference/en-XX/help/370281AD-01/ibool.gif

status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.

/images/reference/en-XX/help/370281AD-01/ii32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

/images/reference/en-XX/help/370281AD-01/istr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

IMAQ Detect Rectangles

Searches for rectangles in an image.

Supported Image Types

8-bit unsigned grayscale

IMAQ Detect Rectangles

/images/reference/en-XX/help/370281AD-01/ccclst.gif

ROI Descriptor is the descriptor that defines the rectangle or rotated rectangle within which to detect shapes.

/images/reference/en-XX/help/370281AD-01/c1di32.gif

Global Rectangle contains the coordinates of the bounding rectangle.

/images/reference/en-XX/help/370281AD-01/c1dcclst.gif

Contours are each of the individual shapes that define an ROI.

/images/reference/en-XX/help/370281AD-01/cenum.gif

ID refers to whether the contour is the external or internal edge of an ROI.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Type is the shape type of the contour.

/images/reference/en-XX/help/370281AD-01/c1di32.gif

Coordinates indicates the relative position of the contour.

/images/reference/en-XX/help/370281AD-01/cgenclasstagrefflat.gif

Image is a reference to the image in which you want to search.

/images/reference/en-XX/help/370281AD-01/cnclst.gif

Rectangle Descriptor specifies the sizes of rectangles to detect.

Note   Width is defined as the length of the shorter side of a rectangle and height is defined as the longer side of the rectangle you want to search for.
/images/reference/en-XX/help/370281AD-01/cdbl.gif

Min Width is the minimum width describing the rectangles to detect.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Max Width is the maximum width describing the rectangles to detect.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Min Height is the minimum height describing the rectangles to detect.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Max Height is the maximum height describing the rectangles to detect.

/images/reference/en-XX/help/370281AD-01/ccclst.gif

Match Options are the match options used when detecting shapes.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Rotation specifies whether or not to search for rotated versions of the shape.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Scale specifies whether or not to search for scaled versions of the shape.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Occlusion specifies whether or not to search for occluded versions of the shape.

/images/reference/en-XX/help/370281AD-01/c1dnclst.gif

Range Settings is an array that specifies the allowable ranges for rotation and scale.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Match Constraints specifies the match option whose values you want to constrain by the given range. The following options are available:

Rotation Angle (degrees) (0)

Set a range for this option to specify the angles at which you expect the VI to find template matches in the inspection image. The VI ignores this range if the Rotation is not enabled.

Scale Factor (%) (1)

Set a range for this option to specify the sizes at which you expect the VI to find template matches in the inspection image. The size is expressed as the following percentage: the size of the match divided by size of the template image, multiplied by 100. The VI ignores this range if the Scale is not enabled.

Occlusion (%) (2)

Set a range for this option to specify the amount of occlusion you expect for a match in the inspection image. NI Vision can accurately detect matches that have up to 50% occlusion. The VI ignores this range if the Occlusion is not enabled.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Min is the minimum value of the range for a given Match Constraint.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Max is the maximum value of the range for a given Match Constraint.

/images/reference/en-XX/help/370281AD-01/cerrcodeclst.gif

error in (no error) describes the error status before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.

/images/reference/en-XX/help/370281AD-01/cbool.gif

status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.

/images/reference/en-XX/help/370281AD-01/ci32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

/images/reference/en-XX/help/370281AD-01/cstr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

/images/reference/en-XX/help/370281AD-01/ccclst.gif

Curve Parameters contains information about how curves are extracted from the inspection image during the match phase.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Extraction Mode specifies how the VI identifies curves in the image. Choose from the following options:

Normal (0)

(Default) Select Normal if you want the VI to make no assumptions about the uniformity of objects in the image or the image background.

Uniform Regions (1)

Select Uniform Regions if you want the VI to assume that either the objects in the image or the image background consist of uniform pixel values. This allows the VI to more accurately calculate the external curves of the objects.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Edge Threshold specifies the minimum contrast a seed point must have for it to begin a curve. Valid values range from 1 to 255. The default value is 75.

/images/reference/en-XX/help/370281AD-01/cu32.gif

Edge Filter Size specifies the width of the edge filter that the VI uses to identify curves in the image. The following options are available:

Fine (0)

Sets the Edge Filter Size to fine.

Normal (1)

(Default) Sets the Edge Filter Size to normal.

Contour Tracing (2)

Sets the Edge Filter Size to contour tracing, which provides the best results for contour extraction but increases the time required to process the image.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Min Length specifies the length, in pixels, of the smallest curve that you want the VI to identify. The VI ignores any curves that have a length less than this value. The default value is 25.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Row Search Step Size specifies the distance, in the y direction, between the image rows that the algorithm inspects for curve seed points. Valid values range from 1 to 255. The default value is 15.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Col Search Step Size specifies the distance, in the x direction, between the image columns that the algorithm inspects for curve seed points. Valid values range from 1 to 255. The default value is 15.

/images/reference/en-XX/help/370281AD-01/ci32.gif

Max Endpoint Gap specifies the maximum gap, in pixels, between the endpoints of a curve that the VI identifies as a closed curve. If the gap is larger than this value, the VI identifies the curve as an open curve. The default value is 10.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Closed specifies whether to identify only closed curves in the image. The default value is FALSE, which specifies that the VI should identify both open and closed curves.

/images/reference/en-XX/help/370281AD-01/cbool.gif

Subpixel specifies whether to detect curve points with subpixel accuracy. The default is FALSE.

/images/reference/en-XX/help/370281AD-01/cdbl.gif

Minimum match score is the minimum score a returned shape can have.

/images/reference/en-XX/help/370281AD-01/i1dcclst.gif

Rectangles is an array of rectangle clusters that describe each found rectangle.

Note  Width is defined as the length of the shorter side of a rectangle and height is defined as the longer side of the rectangle you want to search for.
/images/reference/en-XX/help/370281AD-01/i1dnclst.gif

Corners returns an array of coordinates that specify the corners of the rectangle.

/images/reference/en-XX/help/370281AD-01/idbl.gif

Angle is the orientation of the rectangle.

/images/reference/en-XX/help/370281AD-01/idbl.gif

Width is the width of the rectangle.

/images/reference/en-XX/help/370281AD-01/idbl.gif

Height is the height of the rectangle.

/images/reference/en-XX/help/370281AD-01/idbl.gif

Score is the score of the rectangle.

/images/reference/en-XX/help/370281AD-01/ii32.gif

Number of Matches Returned is the number of matches found.

/images/reference/en-XX/help/370281AD-01/ierrcodeclst.gif

error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out indicator on the front panel and select Explain Error from the shortcut menu for more information about the error.

/images/reference/en-XX/help/370281AD-01/ibool.gif

status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.

/images/reference/en-XX/help/370281AD-01/ii32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

/images/reference/en-XX/help/370281AD-01/istr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

WAS THIS ARTICLE HELPFUL?

Not Helpful