Finding edge points along multiple search contours, Finding points using pattern matching, Finding points using pattern matching -12 – National Instruments IMAQTM User Manual

Page 64

Advertising
background image

Chapter 5

Performing Machine Vision Tasks

IMAQ Vision for Visual Basic User Manual

5-12

ni.com

Finding Edge Points Along Multiple Search Contours

Use the

CWIMAQVision.Rake

,

CWIMAQVision.Spoke

, and

CWIMAQVision.ConcentricRake

methods to find edge points

along multiple search contours. These methods behave like

CWIMAQVision.FindEdges2

, but they find edges on multiple contours.

These methods find only the first edge that meets the criteria along each
contour. Pass in a CWIMAQRegions object to define the search region for
these methods.

CWIMAQVision.Rake

works on a rectangular search region. The search

lines are drawn parallel to the orientation of the rectangle. Control the
number of search lines in the region by specifying the distance, in pixels,
between each line. Specify the search direction as left to right or right to left
for a horizontally oriented rectangle. Specify the search direction as top to
bottom or bottom to top for a vertically oriented rectangle.

CWIMAQVision.Spoke

works on an annular search region, scanning the

search lines that are drawn from the center of the region to the outer
boundary and that fall within the search area. Control the number of lines
in the region by specifying the angle, in degrees, between each line. Specify
the search direction as either going from the center outward or from the
outer boundary to the center.

CWIMAQVision.ConcentricRake

works on an annular search region.

The concentric rake is an adaptation of the rake to an annular region. Edge
detection is performed along search lines that occur in the search region and
that are concentric to the outer circular boundary. Control the number of
concentric search lines that are used for the edge detection by specifying
the radial distance between the concentric lines in pixels. Specify the
direction of the search as either clockwise or counterclockwise.

Finding Points Using Pattern Matching

The pattern matching algorithms in IMAQ Vision measure the similarity
between an idealized representation of a feature, called a template, and the
feature that may be present in an image. A feature is defined as a specific
pattern of pixels in an image. Pattern matching returns the location of the
center of the template and the template orientation. Follow these
generalized steps to find features in an image using pattern matching:

1.

Define a reference or fiducial pattern in the form of a template image.

2.

Use the reference pattern to train the pattern matching algorithm with

CWIMAQVision.LearnPattern2

.

Advertising