Chapter 5
Machine Vision
©
National Instruments Corporation
5-9
IMAQ Vision for LabWindows/CVI User Manual
Programmatically Defining Regions
When you have an automated application, you need to define regions of
interest programmatically. You can programmatically define regions in
two ways:
•
Specify the contours of the ROI.
•
Specify individual structures by providing basic parameters that
describe the region you want to define. You can specify a rotated
rectangle by providing the coordinates of the center, the width, the
height, and the rotation angle. You can specify an annulus by providing
the coordinates of the center, inner radius, outer radius, start angle, and
end angle. You can specify a point by setting its x-coordinates and
y-coordinates. You can specify a line by setting the coordinates of the
start and end points.
See Chapter 3,
Grayscale and Color Measurements
, for more information
about defining regions of interest.
Find Measurement Points
After you set regions of inspection, locate points within those regions on
which you can base measurements. You can locate measurement points
using edge detection, pattern matching, color pattern matching, and color
location.
Finding Features Using Edge Detection
Use the edge detection tools to identify and locate sharp discontinuities
in an image. Discontinuities typically represent abrupt changes in pixel
intensity values, which characterize the boundaries of objects.
Finding Lines or Circles
If you want to find points along the edge of an object and find
a line describing the edge, use
imaqFindEdge()
and
imaqFindConcentricEdges()
. The
imaqFindEdge()
function finds
edges based on rectangular search areas, as shown in Figure 5-5. The
imaqFindConcentricEdge()
function finds edges based on annular
search areas.