LineGauge Method

NI Vision for Visual Basic

LineGauge Method

Syntax

CWIMAQVision.LineGauge SourceImage, x1, y1, x2, y2, EdgeContrast, FilterWidth, FilterSteepness, InterpolationMethod, SubPixelAccuracy, MeasurementType, Origin1X, Origin1Y, Angle1, Origin2X, Origin2Y, Angle2, Distances [, XOffsetArray] [, YOffsetArray]

Return Type

Long

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

Purpose

Obsolete—Use LineGauge2 instead. 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. This method also can step and repeat its 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.

x1 As Long

The x-coordinate of the start point of the line.

y1 As Long

The y-coordinate of the start point of the line.

x2 As Long

The x-coordinate of the end point of the line.

y2 As Long

The y-coordinate of the end point of the line.

EdgeContrast As Long

The threshold value for the contrast of the edge. The method identifies only edges with a contrast greater than this value in the detection process.

FilterWidth As Long

The number of pixels that the method averages to find the contrast at either side of the edge.

FilterSteepness As Long

Number of pixels that the function averages to find the contrast at either side of the edge.

InterpolationMethod As CWIMAQInterpolateMethods

The method for interpolating. The following values are valid:

  • cwimaqInterpolateQuadratic--quadratic interpolation

  • cwimaqInterpolateCubic--cubic spline interpolation

SubPixelAccuracy As CWIMAQSubPixelAccuracyValues

The number of samples the method obtains from a pixel. A subpixel accuracy of one-fourth specifies that the method splits each pixel into four subpixels.

MeasurementType As CWIMAQLineGaugeMeasurements

The measurement method.

Origin1X As Long

The x-coordinate of the origin of the initial coordinate system.

Origin1Y As Long

The y-coordinate of the origin of the initial coordinate system.

Angle1 As Single

The angle, in degrees, of the initial coordinate system.

Origin2X As Long

The x-coordinate of the origin of the final coordinate system.

Origin2Y As Long

The y-coordinate of the origin of the final coordinate system.

Angle2 As Single

The angle, in degrees, of the final coordinate system.

Distances As Variant

On return, an array containing the measured distances.

XOffsetArray As Variant

[Optional] An array of points that specifies the x-coordinate shift in the start and end points of the measurement. The method uses this parameter for repeating the measurement across the image. For each shift, specify two elements in the array. 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 an array of four elements.

YOffsetArray As Variant

[Optional] An array of points that specifies the y-coordinate shift in the start and end points of the measurement. The method uses this parameter for repeating the measurement across the image. For each shift, specify two elements in the array. 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 an array of four elements.

See Also

LineGauge2