Chapter5 MachineVision
IMAQVision for LabWindows/CVI User Manual 5-26 ni.com
Convert Pixel Coordinates to Real-World Coordinates
The measurementp oints you located with edge detection and pattern
matchingare in pixel coordinates. If you need to make measurements using
real-worldunits, use imaqTransformPixelToRealWorld() to convert
the pixel coordinates into real-world units.
Make Measurements
You can make different typesof measurements either directly from the
image or from points that you detect in the image.

Distance Measurements

Use the following functions to make distance measurements for your
inspectionapplication.
Clampfunctions measure the separation between two edges in a
rectangular search region. First, clamp functions detect points along the
two edges using the rake function. Then, theyc ompute the distance
betweenthe points detected on the edges along each search line of the rake
and return the largestor smallest distance. The imaqSelectRect()
functiongenerates a valid input search region for these functions. You also
need to specify theparameters for edge detectiona nd theseparation
between the search lines that you want to use within the search region to
findthe edges. These functions work directly on the image under
inspection, and they output the coordinates of all the edge points that they
find.The following list describes the available clamp functions:
imaqClampMax()Measuresthe largest separation between
twoedges in a rectangular search region.
imaqClampMin()Findsthe smallest separation between two edges.
Use imaqGetDistance()to compute the distances between two points,
such asconsecutive pairs of points in an array of points. You can obtain
thesepoints from the image using any one of the featuredetection methods
described in the FindMeasurement Points section of this chapter.