Chapter 5
Performing Machine Vision Tasks
©
National Instruments Corporation
5-27
IMAQ Vision for LabWindows/CVI User Manual
Analytic Geometry Measurements
Use the following functions to make geometrical measurements from the
points you detect in the image:
•
imaqFitLine()
—Fits a line to a set of points and computes the
equation of the line.
•
imaqFitCircle2()
—Fits a circle to a set of at least three points and
computes its area, perimeter, and radius.
•
imaqFitEllipse2()
—Fits an ellipse to a set of at least six points
and computes its area, perimeter, and the lengths of its major and
minor axis.
•
imaqGetIntersection()
—Finds the intersection point of two
lines specified by their start and end points.
•
imaqGetAngle()
—Finds the smaller angle between two lines.
•
imaqGetPerpendicularLine()
—Finds the perpendicular line
from a point to a line and computes the perpendicular distance between
the point and the line.
•
imaqGetBisectingLine()
—Finds the line that bisects the angle
formed by two lines.
•
imaqGetMidLine()
—Finds the line that is midway between a point
and a line and is parallel to the line.
•
imaqGetPolygonArea()
—Calculates the area of a polygon
specified by its vertex points.
Instrument Reader Measurements
You can make measurements based on the values obtained by meter and
LCD readers.
Use
imaqGetMeterArc()
to calibrate a meter or gauge that you want to
read. The
imaqGetMeterArc()
function calibrates the meter using one of
two modes. The
IMAQ_METER_ARC_ROI
mode uses the initial position and
the full-scale position of the needle. When using this mode, the function
calculates the position of the base of the needle and the arc traced by the tip
of the needle. The
IMAQ_METER_ARC_POINTS
mode calibrates the meter
using three points on the meter: the base of the needle, the tip of the needle
at its initial position, and the tip of the needle at its full-scale position.
When using this mode, the function calculates the position of the points
along the arc covered by the tip of the needle. Use
imaqReadMeter()
to
read the position of the needle using the base of the needle and the array of
points on the arc traced by the tip of the needle.