Table Of Contents

Find CoordSys (Find CoordSys (2 Rects)) (G Dataflow)

Last Modified: October 26, 2017

Computes a coordinate system based on the position of an object in two search areas 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 has the capability to 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.

connector_pane_image
datatype_icon

mode

Function that is performed by this node.

You can choose from the following values:

Name Value Description
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.

datatype_icon

options

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

datatype_icon

direction

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
datatype_icon

Primary Edge Options

Parameters that are used to compute the edge gradient information and detect the edges along the primary ROI descriptor.

datatype_icon

edge polarity

Polarity of the edges to be found.

Name Value Description
all edges 0

(Default) Searches for all edges

rising edges 1

Searches for rising edges

falling edges 2

Searches for falling edges

datatype_icon

kernel size

Size of the edge detection kernel.

Default: 3

datatype_icon

width

Number of pixels averaged perpendicular to the search direction to compute the edge profile strength at each point along the search ROI.

Default: 3

datatype_icon

minimum edge strength

Minimum edge strength, or gradient magnitude, required for a detected edge.

Default: 10

datatype_icon

interpolation type

Interpolation method used to locate the edge position.

Name Description
zero order Rounds to the nearest integral edge location
bilinear Uses bilinear interpolation to compute the edge location
bilinear fixed (Default) Uses the fixed-point computation of bilinear interpolation to determine the edge location
datatype_icon

data processing method

Method used to process the data extracted for edge detection.

Name Description
average (Default) Averages the data extracted for edge detection
median Takes the median of the data extracted for edge detection
datatype_icon

Secondary Edge Options

Parameters that are used to compute the edge gradient information and detect the edges along the secondary ROI descriptor.

datatype_icon

edge polarity

Polarity of the edges to be found.

Name Value Description
all edges 0

(Default) Searches for all edges

rising edges 1

Searches for rising edges

falling edges 2

Searches for falling edges

datatype_icon

kernel size

Size of the edge detection kernel.

Default: 3

datatype_icon

width

Number of pixels averaged perpendicular to the search direction to compute the edge profile strength at each point along the search ROI.

Default: 3

datatype_icon

minimum edge strength

Minimum edge strength, or gradient magnitude, required for a detected edge.

Default: 10

datatype_icon

interpolation type

Interpolation method used to locate the edge position.

Name Description
zero order Rounds to the nearest integral edge location
bilinear Uses bilinear interpolation to compute the edge location
bilinear fixed (Default) Uses the fixed-point computation of bilinear interpolation to determine the edge location
datatype_icon

data processing method

Method used to process the data extracted for edge detection.

Name Description
average Averages the data extracted for edge detection
median Takes the median of the data extracted for edge detection

Default: Average

datatype_icon

show search area

Boolean that specifies if the ROI is overlaid on the image.

datatype_icon

show search lines

Boolean that specifies if the search lines used to locate the edges are overlaid on the image.

datatype_icon

show edges found

Boolean that specifies if the locations of the edges found are overlaid on the resulting image.

datatype_icon

show result

Boolean that determines whether the coordinate system found is overlaid on the result image.

datatype_icon

search area color

Color used to overlay the search area.

datatype_icon

search lines color

Color used to overlay the search lines.

datatype_icon

edge locations color

Color used to overlay the edge locations.

datatype_icon

result color

Color used to overlay the result.

datatype_icon

overlay group name

Group name for the step overlays.

datatype_icon

image in

Reference to the source image.

datatype_icon

primary ROI descriptor

Descriptor that defines the region of interest (ROI) within which the edge detection is performed.

datatype_icon

Global Rectangle

Coordinates of the bounding rectangle.

datatype_icon

contours

Individual shapes that define an ROI.

datatype_icon

ID

Control specifying whether the contour is the external or internal edge of an ROI.

datatype_icon

type

Shape type of the contour.

datatype_icon

coordinates

Relative position of the contour.

datatype_icon

secondary ROI descriptor

Descriptor that defines the region of interest (ROI) within which the edge detection is performed.

datatype_icon

Global Rectangle

Coordinates of the bounding rectangle.

datatype_icon

contours

Individual shapes that define an ROI.

datatype_icon

ID

Control specifying whether the contour is the external or internal edge of an ROI.

datatype_icon

type

Shape type of the contour.

datatype_icon

coordinates

Relative position of the contour.

datatype_icon

coordinate system in

Coordinate system to update.

This input is required only when mode is set to update CoordSys. When mode is set to find reference, the node ignores this parameter.

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

primary line fit options

Options that are used to detect the straight edges.

datatype_icon

number of lines

Number of straight edges to find.

Default: 1

datatype_icon

type

Method used to find the straight edge.

Choose from the following options:

Name Description
first edge rake Fits a straight edge on the first points detected using a rake
best edge rake Fits a straight edge on the best points detected using a rake
Hough edge rake Finds the strongest straight edge using all points detected on a rake
first edge projection Uses the location of the first projected edge as the straight edge
best edge projection (Default) Finds the strongest projected edge location to determine the straight edge
datatype_icon

min. score

Minimum score of a detected straight edge.

Default: 10

datatype_icon

max. score

Maximum score of a detected straight edge.

Default: 1000

datatype_icon

orientation

Angle at which the straight edge is expected to be found.

Default: 0

datatype_icon

angle range

Positive and negative range around the orientation within which the straight edge is found.

Default: 10

datatype_icon

angle tolerance

Expected angular accuracy of the straight edge.

Default: 1

datatype_icon

step size

Gap in pixels between the search lines used with the rake-based methods.

Default: 7

datatype_icon

min. SNR (db)

Minimum signal to noise ratio (SNR) of the edge points used to fit the straight edge.

Default: 0

datatype_icon

min. points (%)

Minimum number for points as a percentage of the number of search lines to include in the detected straight edge.

Default: 25%

datatype_icon

Hough iterations

Number of iterations used in the Hough-based method.

Default: 5

datatype_icon

secondary line fit options

Options that are used to detect the straight edges.

datatype_icon

number of lines

Number of straight edges to find.

Default: 1

datatype_icon

type

Method used to find the straight edge.

Choose from the following options:

Name Description
first edge rake Fits a straight edge on the first points detected using a rake
best edge rake Fits a straight edge on the best points detected using a rake
Hough edge rake Finds the strongest straight edge using all points detected on a rake
first edge projection Uses the location of the first projected edge as the straight edge
best edge projection (Default) Finds the strongest projected edge location to determine the straight edge
datatype_icon

min. score

Minimum score of a detected straight edge.

Default: 10

datatype_icon

max. score

Maximum score of a detected straight edge.

Default: 1000

datatype_icon

orientation

Angle at which the straight edge is expected to be found.

Default: 0

datatype_icon

angle range

Positive and negative range around the orientation within which the straight edge is found.

Default: 10

datatype_icon

angle tolerance

Expected angular accuracy of the straight edge.

Default: 1

datatype_icon

step size

Gap in pixels between the search lines used with the rake-based methods.

Default: 7

datatype_icon

min. SNR (db)

Minimum signal to noise ratio (SNR) of the edge points used to fit the straight edge.

Default: 0

datatype_icon

min. points (%)

Minimum number for points as a percentage of the number of search lines to include in the detected straight edge.

Default: 25%

datatype_icon

Hough iterations

Number of iterations used in the Hough-based method.

Default: 5

datatype_icon

image out

Reference to the destination image.

The search area and/or the result of the measurement can be overlaid on the image according to the settings.

datatype_icon

main axis

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 primary ROI descriptor.

datatype_icon

secondary axis

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 secondary ROI descriptor.

datatype_icon

coordinate system out

Cluster returning the position of the coordinate system.

datatype_icon

Reference System

Cluster containing the following elements.

datatype_icon

origin

Point cluster that specifies the origin of the base-reference coordinate system.

datatype_icon
x

X-coordinate of the point.

datatype_icon
y

Y-coordinate of the point.

datatype_icon

angle (deg)

Angle that the base-reference coordinate system makes with the image coordinate system.

datatype_icon

axis reference

Direction of the y-axis of the base-reference coordinate system.

datatype_icon

Measurement System

Cluster containing the following elements.

datatype_icon

origin

Point cluster that specifies the origin of the base-reference coordinate system.

datatype_icon
x

X-coordinate of the point.

datatype_icon
y

Y-coordinate of the point.

datatype_icon

angle (deg)

Angle that the base-reference coordinate system makes with the image coordinate system.

datatype_icon

axis reference

Direction of the y-axis of the base-reference coordinate system.

datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Find CoordSys (2 Rects) Algorithm Details

The node uses the following algorithm. First, the node determines the position of the main axis of the coordinate system. It locates the intersection points between a set of parallel search lines, in the primary ROI descriptor, and the edge of an object. The intersection points are determined based on their edge strength. The node calculates a best-fit line through the points found. This line defines the main axis of the coordinate system. The process is repeated perpendicularly in the secondary ROI descriptor in order to locate the secondary axis. The intersection between the main axis and secondary axis is the origin of the coordinate system.

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

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics