IMAQ Find CoordSys (Rect) 2 VI

LabView NI Vision

IMAQ Find CoordSys (Rect) 2 VI

Owning Palette: Coordinate SystemInstalled With: NI Vision Development Module

Computes a coordinate system based on the position of an object in a search area of an image. The location and orientation of the coordinate system found is used to create the reference position of a coordinate system or to update the current location and orientation of an existing Coordinate System. The function can overlay the following on the returned image: the position of the search area, the search lines, the edges found, and the location and orientation of the coordinate system found.

Details

IMAQ Find CoordSys (Rect) 2

cu16.gif

Mode specifies the function that is performed by this VI. You can choose from the following values:

Find Reference (0)

Specifies that the location and orientation of the found edges set the reference system of Coordinate System Out. This is typically the first mode to use when setting up a coordinate system.

Update CoordSys (1)

Specifies that the location and orientation of the found edges set the measurement system of Coordinate System Out. The reference system of Coordinate System In remains unchanged in Coordinate System Out. Use this mode with each new inspection image to update the location and orientation of the edges defining the coordinate system.

ccclst.gif

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

cu16.gif

Direction specifies the order and direction in which the edges are searched. The arrow in the Direction symbol specifies the search direction for the Main Axis, while the perpendicular sign determines the position of the perpendicular axis.

Value Main Axis Secondary Axis
0 Horizontal – Left to Right Bottom to Top
1 Horizontal – Left to Right Top to Bottom
2 Vertical – Top to Bottom Left to Right
3 Vertical – Top to Bottom Right to Left
4 Horizontal – Right to Left Top to Bottom
5 Horizontal – Right to Left Bottom to Top
6 Vertical – Bottom to Top Right to Left
7 Vertical – Bottom to Top Left to Right
cnclst.gif

Edge Options specifies the parameters that are used to compute the edge gradient information and detect the edges.

cu32.gif

Edge Polarity specifies the polarity of the edges to be found.

All Edges (0)

(Default) Searches for all edges

Rising Edges (1)

Searches for rising edges

Falling Edges (2)

Searches for falling edges

cu32.gif

Kernel Size specifies the size of the edge detection kernel. The default is 3.

cu32.gif

Width specifies the number of pixels averaged perpendicular to the search direction to compute the edge profile strength at each point along the search ROI. The default is 3.

csgl.gif

Minimum Edge Strength specifies the minimum edge strength (gradient magnitude) required for a detected edge. The default is 10.

cenum.gif

Interpolation Type specifies the interpolation method used to locate the edge position. Choose from the following options:

Zero Order (0)

Rounds to the nearest integral edge location

Bilinear (1)

Uses bilinear interpolation to compute the edge location

Bilinear Fixed (4)

(Default) Uses the fixed-point computation of bilinear interpolation to determine the edge location

cenum.gif

Data Processing Method is the method used to process the data extracted for edge detection.

Average (0)

(Default) Averages the data extracted for edge detection

Median (1)

Takes the median of the data extracted for edge detection

cbool.gif

Show Search Area determines whether the search area is overlaid on the image.

cbool.gif

Show Search Lines determines whether the search lines used to locate the edges are overlaid on the image.

cbool.gif

Show Edges Found determines whether the locations of the edges found are overlaid on the result image.

cbool.gif

Show Result determines whether the coordinate system found is overlaid on the result image.

cu32.gif

Search Area Color specifies the color to use to overlay the search area.

cu32.gif

Search Lines Color specifies the color to use to overlay the search lines.

cu32.gif

Edge Locations Color specifies the color to use to overlay the edge locations.

cu32.gif

Result Color specifies the color to use to overlay the result.

cstr.gif

Overlay Group Name specifies the overlay group name for the step overlays.

cgenclasstagrefflat.gif

Image is a reference to the image in which the coordinate system is to be located.

ccclst.gif

ROI Descriptor is a descriptor that defines the rectangle, rotated rectangle, or other four-side rectangular polygon within which the edge detection is performed.

c1di32.gif

Global Rectangle contains the coordinates of the bounding rectangle.

c1dcclst.gif

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

cenum.gif

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

cu32.gif

Type is the shape type of the contour.

c1di32.gif

Coordinates indicates the relative position of the contour.

ccclst.gif

Coordinate System In specifies the coordinate system to update. This input is required only when Mode is set to Update CoordSys. When Mode is set to Find Reference, the VI ignores this parameter.

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.

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.

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.

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.

cnclst.gif

Line Options specifies the options that are used to detect the straight edges.

ci32.gif

Number of Lines specifies the number of straight edges to find. The default is 1.

cu32.gif

Type specifies the method used to find the straight edge. Choose from the following options:

First Edge Rake (0)

Fits a straight edge on the first points detected using a Rake

Best Edge Rake (1)

Fits a straight edge on the best points detected using a Rake

Hough Edge Rake (2)

Finds the strongest straight edge using all points detected on a Rake

First Edge Projection (3)

Uses the location of the first projected edge as the straight edge

Best Edge Projection (4)

(Default) Finds the strongest projected edge location to determine the straight edge

cdbl.gif

Min. Score specifies the minimum score of a detected straight edge. The default is 10.

cdbl.gif

Max. Score specifies the maximum score of a detected straight edge. The default is 1000.

cdbl.gif

Orientation specifies the angle at which the straight edge is expected to be found. The default is 0.

cdbl.gif

Angle Range specifies the positive and negative range around the Orientation within which the straight edge is expected to be found. The default is 10.

cdbl.gif

Angle Tolerance specifies the expected angular accuracy of the straight edge. The default is 1.

cu32.gif

Step Size specifies the gap in pixels between the search lines used with the Rake-based methods. The default is 3.

cdbl.gif

Min. SNR (db) specifies the minimum signal to noise ratio (SNR) of the edge points used to fit the straight edge. The default is 0.

cdbl.gif

Min. Points (%) specifies the minimum number for points as a percentage of the number of search lines that need to be included in the detected straight edge. The default is 25%.

ci32.gif

Hough Iterations specify the number of iterations used in the Hough-based method. The default is 5.

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.

icclst.gif

Main Axis returns a cluster of two point coordinates specifying the coordinates of the edge that corresponds to the Main Axis. The first point is the intersection of the two axes of the coordinate system. The second point is the result of the computation of the intersection of the Main Axis with the ROI Descriptor.

icclst.gif

Coordinate System Out is a cluster returning the position of the coordinate system.

ccclst.gif

Reference System is a cluster containing the following elements.

cnclst.gif

Origin is a point cluster that specifies the origin of the base-reference coordinate system.

isgl.gif

X is the x-coordinate of the point.

csgl.gif

Y is the y-coordinate of the point.

csgl.gif

Angle (deg) is the angle the base-reference coordinate system makes with the image coordinate system.

cu32.gif

Axis Reference is the direction of the y-axis of the base-reference coordinate system.

ccclst.gif

Measurement System is a cluster containing the following elements.

cnclst.gif

Origin is a point cluster that specifies the origin of the base-reference coordinate system.

isgl.gif

X is the x-coordinate of the point.

csgl.gif

Y is the y-coordinate of the point.

csgl.gif

Angle (deg) is the angle the base-reference coordinate system makes with the image coordinate system.

cu32.gif

Axis Reference is the direction of the y-axis of the base-reference coordinate system.

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.

ibool.gif

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

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.

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.

icclst.gif

Secondary Axis returns a cluster of two point coordinates specifying the coordinates of the edge that corresponds to the Secondary Axis. The first point is the intersection of the two axis of the coordinate system. The second point is the result of the computation of the intersection of the Secondary Axis with the ROI Descriptor.

Details

The VI uses the following algorithm. First, the VI determines the position of the Main Axis of the coordinate system. It locates the intersection points between a set of parallel search lines, or rake, and the edge of an object. The intersection points are determined based on their edge strength. The VI calculates a best-fit line using the points found. This line defines the Main Axis of the coordinate system. The VI then locates the intersection points between a set of parallel search lines, or rake, perpendicular to the Main Axis and the edge of the object. It calculates a hit-line to the object from the edge closest to the search area detected and perpendicular to the Main Axis. This line defines the Secondary Axis of the coordinate system. The intersection between the Main Axis and Secondary Axis is the origin of the coordinate system.

The VI sets the reference position and orientation of the coordinate system or updates its position depending on the Mode chosen.