LineGauge2 Method

NI Vision for Visual Basic

LineGauge2 Method

Syntax

CWIMAQVision.LineGauge2 SourceImage, Line, EdgeOptions, MeasurementType, Distances [, ReferenceCoordinateSystem] [, MeasurementCoordinateSystem] [, Offsets]

Return Type

Long

On success, this method returns 0. On failure, this method returns a negative number.

Purpose

Measures the distance between selected edges with high-precision subpixel accuracy. You can use different measurement modes with this method, such as measuring distances between points and edges and vice versa. Use the ReferenceCoordinateSystem and the MeasurementCoordinateSystem to transform the line used to perform the measurements. Use Offsets to step and repeat measurements across the image. Depending on the type of the measurement, this method first determines the relevant edges in the image before computing the distances.

Remarks

Use this method with U8, I16, and SGL images.

Parameters

SourceImage As CWIMAQImage

The image in which the method measures the distance between edges.

Line As CWIMAQLine

The line along which the method performs the measurement.

EdgeOptions As CWIMAQEdgeOptions

Defines the characteristics that the method uses to find the edges and the parameters it needs for subpixel analysis of the edges. Subpixel information is not used when measuring distances between points.

MeasurementType As CWIMAQLineGaugeMeasurements

The measurement method.

Distances As Variant

On return, an array containing the measured distances.

ReferenceCoordinateSystem As Variant

[Optional] A CWIMAQCoordinateSystem object that specifies the reference coordinate system if you want to perform a coordinate transformation of the line used for the measurement.

MeasurementCoordinateSystem As Variant

[Optional] A CWIMAQCoordinateSystem object that specifies the measurement coordinate system if you want to perform a coordinate transformation of the line used for the measurement.

Offsets As Variant

[Optional] A CWIMAQPoints collection that specifies the shift in the start and end points of the line used for the measurement. Use this parameter to repeat measurements across the image. For each shift, specify two items in the collection. The first element indicates the shift of the start point, and the second element indicates the shift of the end point. For example, to shift the measurement twice, specify a collection of four items.

Example