Chapter5 MachineVision
©NationalInstruments Corporation 5-3 IMAQVision for LabWindows/CVI User Manual
appearsshifted and rotated in the image you need to process. This
coordinate system is referred to as the measurement coordinate system.
The m easurement methods automatically movethe ROIs to the correct
position using the position of the measurement coordinate system with
respectto the reference coordinate system. For information about
coordinate systems, see Chapter 13, Dimensional Measurements,of
the IMAQ Vision Concepts Manual.
Youcan build a coordinate transform using edge detection or pattern
matching.The output of the edge detecti on and pattern matching functions
thatbuild a coordinate system are the origin, angle, and axes direction of
thecoordinate system. Some machine visi onf unctions take this output and
adjustthe regions of inspection automatically. You can also use these
outputs to move the regions of inspection relative to the object
programmatically.
UsingEdgeDetectiontoBuildaCoordinateTransform
Youcan build a coordinate transform using two edge detection techniques.
Use imaqFindTransformRect()to define a coordinate system u sing
one rectangular region. Use imaqFindTransformRects() to define a
coordinate system using two independent rectangular regions. Follow the
steps below to build a coordinate transform using edge detection:
Note Touse this technique, the object cannot rotate more than ±65° in the image.
1. Specify one or tworectangular regions.
a. Ifyou use imaqFindTransformRect(), specify one rectangular
ROIthat includes part of two straight, nonparallel boundaries of
the object, as shownin Figure 5-2. This rect angular regionm ust
belarge enough to include these boundariesin all the im ages you
wantto inspect .