IMAQ Count Objects 2 VI

Owning Palette: Count and Measure Objects
Requires: NI Vision Development Module

Locates, counts, and measures objects in a rectangular search area. This VI uses a threshold on the pixel intensities to segment the objects from their background.

Details

Supported Image Types

8-bit unsigned grayscale 16-bit unsigned grayscale 16-bit signed grayscale floating point grayscale

IMAQ Count Objects 2

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

Settings is a cluster defining the parameters of the algorithm and the information that is overlaid on the result image.

/images/reference/en-XX/help/370281AG-01/cu16.gif

Objects specifies the type of objects to detect.

Bright Objects (0)

Searches for bright objects.

Dark Objects (1)

Searches for dark objects.

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

Threshold specifies the grayscale intensity that is used as threshold level. When a Bright Objects type is selected, the threshold range used includes Threshold to the maximum possible intensity depending of the image type (255 for a 8-bit image). When a Dark Objects type is selected, the threshold range used includes the minimum possible intensity depending of the image type (0 for a 8-bit image) up to Threshold.

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

Ignore Objects touching Image Borders specifies whether the binary objects touching the borders of the search area are ignored.

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

Fill Holes within Objects specifies whether the holes in the binary objects are ignored.

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

Minimum Object Size specifies whether the detected objects smaller than Min Size are ignored.

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

Min Size specifies the size of the objects to ignore. When the parameter Minimum Objects Size is set to TRUE, the objects which size is smaller than or equal to Min Size are ignored.

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

Maximum Object Size specifies whether the detected objects larger than Max Size are ignored.

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

Max Size specifies the size of the objects to ignore. When the parameter Maximum Object Size is set to TRUE, the objects which size is larger than or equal to Max Size are ignored.

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

Show Search Area determines whether to overlay the ROI on the image.

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

Show Center determines whether the locations of the objects found are overlaid on the image.

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

Show Bounding Box determines whether the bounding rectangles of the objects found are overlaid on the image.

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

Image is a reference to the source image.

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

Search Rect (entire image) specifies the rectangular region of the image where the objects are located. The default value specifies a search on the entire image.

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

Left is the x-coordinate of the upper left corner of the rectangle.

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

Top is the y-coordinate of the upper left corner of the rectangle.

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

Right is the x-coordinate of the bottom right corner of the rectangle.

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

Bottom is the y-coordinate of the bottom right corner of the rectangle.

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

Rotation specifies the rotation angle in degrees of the rectangle with its center as point of rotation. If the rotation angle does not equal zero, the Left, Top, Right, and Bottom coordinates are not the actual coordinates of the upper left and bottom right corner of the rectangle, but their position if the rotation angle equals zero.

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

Coordinate System specifies the coordinate system to which the Search Rect is linked. If the Coordinate System input is used (connected), the location of the Search Rect is shifted and rotated by the difference between the reference position of the coordinate system and its new location.

/images/reference/en-XX/help/370281AG-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/370281AG-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/370281AG-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/370281AG-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/370281AG-01/i1dcclst.gif

Objects is an array of clusters that return the following elements for each object located.

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

Object Center is a point-coordinate cluster specifying the location of the center of mass of the binary object detected.

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

Bounding Box is the bounding rectangle of the binary object.

/images/reference/en-XX/help/370281AG-01/isgl.gif

Area is the area of the binary object detected.

/images/reference/en-XX/help/370281AG-01/isgl.gif

Orientation returns the orientation of the longest segment in the binary object.

/images/reference/en-XX/help/370281AG-01/isgl.gif

Aspect Ratio is the ratio between the width and the height of the binary object.

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

Nb Holes returns the number of holes found in the binary object.

/images/reference/en-XX/help/370281AG-01/igenclasstagrefflat.gif

Image Out is a reference to the destination image. The search area and/or the result of the measurement may be overlaid on the image according to the settings.

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

Number of Objects is the number of objects located in the search area based on the input Settings.

/images/reference/en-XX/help/370281AG-01/icclst.gif

Coordinate System (duplicate) is a reference to the coordinate system.

/images/reference/en-XX/help/370281AG-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/370281AG-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/370281AG-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/370281AG-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.

Details

Optional filters give the capability to ignore the objects smaller or larger than given sizes. Other options allow rejecting the objects touching the borders of the search area and ignoring the holes that the segmentation process may create in the objects. The segmented objects are then located and measured. IMAQ Count Objects 2 can overlay on the image returned the position of the search area, the centers and bounding rectangles of the objects detected.

WAS THIS ARTICLE HELPFUL?

Not Helpful