Chapter 5
Machine Vision
©
National Instruments Corporation
5-3
IMAQ Vision for LabWindows/CVI User Manual
appears shifted and rotated in the image you need to process. This
coordinate system is referred to as the measurement coordinate system.
The measurement methods automatically move the ROIs to the correct
position using the position of the measurement coordinate system with
respect to the reference coordinate system. For information about
coordinate systems, see Chapter 13,
Dimensional Measurements
, of
the
IMAQ Vision Concepts Manual
.
You can build a coordinate transform using edge detection or pattern
matching. The output of the edge detection and pattern matching functions
that build a coordinate system are the origin, angle, and axes direction of
the coordinate system. Some machine vision functions take this output and
adjust the regions of inspection automatically. You can also use these
outputs to move the regions of inspection relative to the object
programmatically.
Using Edge Detection to Build a Coordinate Transform
You can build a coordinate transform using two edge detection techniques.
Use
imaqFindTransformRect()
to define a coordinate system using
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
To use this technique, the object cannot rotate more than ±65
°
in the image.
1.
Specify one or two rectangular regions.
a.
If you use
imaqFindTransformRect()
, specify one rectangular
ROI that includes part of two straight, nonparallel boundaries of
the object, as shown in Figure 5-2. This rectangular region must
be large enough to include these boundaries in all the images you
want to inspect.