Chapter5 MachineVision
©NationalInstruments Corporation 5-27 IMAQVision 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()Fitsa line to a set of points a ndcom putes the
equation of the line.
imaqFitCircle()Fitsa circle to a set of at least three points and
computes its area, perimeter and radius.
imaqFitEllipse()Fitsan ellipse to a set of at least six points and
computes its area, perimeter,and the l engths of its major and minor
axis.
imaqGetIntersection()Findsthe intersection point of two lines
specifiedby their start and end points.
imaqGetAngle()Findsthe smaller angle between two lines.
imaqGetPerpendicularLine()Findsthe perpen dicular line
froma point to a line and computes the perpendicular distance between
the point and the line.
imaqGetBisectingLine()Findsthe li ne that bisects the angle
formed bytwo lin es.
imaqGetMidLine()Findsthe line that is m idwaybe tween a point
and a line and is parallel to the line.
imaqGetPolygonArea()Calculatesthe area of a polygo n
specifiedby its vertex points.
Instrument Reader Measurements
Youcan make measurements based on the values obtained by meter, LCD,
and barcode readers.
Use imaqGetMeterArc()to calibrate a meter or gauge that you want to
read.The imaqGetMeterArc() function calibrates the meter using one of
twomodes. The IMAQ_METER_ARC_ROI mode uses the initial position and
the full-scale position of the needle. When using this mode, the function
calculatesthe position of the base of the needle and the arc traced by the tip
ofthe needle. The IMAQ_METER_ARC_POINTSmode calibrates the meter
usingthree points on the meter: the b ase 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 coveredby the tip of the needle. Use imaqReadMeter() to
readthe position of the needle using the base of the needle and the array of
points on thearc traced by the tip of the needle.