
Chapter5 MachineVision
©NationalInstruments Corporation 5-9 IMAQVision for LabWindows/CVI User Manual
Programmatically Defining Regions
When you have an automatedapplication, you need to define regions of
interestprogrammatically. Youcan programmatically define regions in
two ways:
•Specify the contours of the ROI.
•Specify individualstructures by providing basic parameters that
describe the regionyo u wantto define. You can specify a rotated
rectangle byproviding the coordinates of the center, the width, the
height,and the rotationangle. Youcan specify an annulus by providing
thecoordinates 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 set ting the coordinates of the
start and end points.
SeeChapter 3,Grayscale and Color Measu rements, for more information
about definingregions of interest.
Find Measurement PointsAfter 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
al ine describingthe edge, use imaqFindEdge() and
imaqFindConcentricEdges().TheimaqFindEdge() function finds
edges based on rectangular search areas,as shown in Figure5 -5. The
imaqFindConcentricEdge()function fin ds edges based on annular
search areas.