imaqFindTransformPattern

NI Vision for LabWindows/CVI Function

imaqFindTransformPattern

Usage

int imaqFindTransformPattern(Image* image, Image* pattern, CoordinateTransform2* transform, RotatedRect searchRect, FindTransformMode mode, const FindTransformPatternOptions* options, AxisReport* report);

Purpose

Computes a coordinate transform based on the position of a template image in a search area of an image. The function uses the location and orientation of the coordinate system it finds to create the reference system of a coordinate transform or to update the measurement system of an existing coordinate transform.

Image Types Supported

IMAQ_IMAGE_U8

Parameters

Name

Type

Description

image Image* The image which the function uses to compute the coordinate transform.
pattern Image* The template image which the function attempts to locate. Attach pattern matching information to this image using imaqLearnPattern(). If you have not attached pattern matching information to the image, the function learns the pattern and appends the pattern matching information to the image. If you attach pattern matching information to the image that does not contain the information specified by the matchMode element of the options parameter, the function generates an error.
transform CoordinateTransform2* The coordinate transform the function updates based on the location and position of the pattern. This parameter is required and cannot be NULL.
searchRect RotatedRect The coordinate location of the rectangular search area the function looks in for the pattern. The function searches the bounding rectangle of searchRect. To search the entire image, set this parameter to IMAQ_NO_ROTATED_RECT.
mode FindTransformMode Specifies how the function updates the coordinate transform.
options const FindTransformPatternOptions* Defines the parameters of the algorithm the function uses to locate the pattern and the information the function overlays to the image.
report AxisReport* On return, a report describing the location of the pattern corresponding to the main axis and the secondary axis. Set this parameter to NULL if you do not need this information.

Return Value

Type

Description

int On success, this function returns a non-zero value. On failure, this function returns 0. To get extended error information, call imaqGetLastError().

Parameter Discussion

options—Set the options parameter to NULL to use the default options, as follows:

matchMode IMAQ_MATCH_SHIFT_INVARIANT
minMatchScore 500
subpixelAccuracy FALSE
angleRanges NULL (all angles allowed)
numRanges 0
showSearchArea FALSE
showFeatureFound FALSE
showResult TRUE