MatchPattern Method

NI Vision for Visual Basic

MatchPattern Method

Syntax

CWIMAQVision.MatchPattern SearchImage, Template, MatchPatternOptions, PatternMatchReport [, SearchRectangle]

Return Type

Long

On success, this method returns 0. On failure, this method returns a negative number.

Purpose

Obsolete—Use MatchPattern2 instead. Searches for a pattern, or template image, in the input Image. Use LearnPattern prior to using this method to ensure that the template image has been configured for the pattern match stage.

Remarks

Use this method with U8 images.

Parameters

SearchImage As CWIMAQImage

The image in which the template image is to be located.

Template As CWIMAQImage

The image to be located during the pattern matching process. The template image is the image supplied to LearnPattern.

MatchPatternOptions As CWIMAQMatchPatternOptions

A CWIMAQMatchPatternOptions object that specifies the parameters the method uses for matching.

PatternMatchReport As CWIMAQPatternMatchReport

On return, a report containing information about each match found in the image.

SearchRectangle As Variant

[Optional] A CWIMAQRectangle object that specifies the rectangular region within an image in which to search for the template pattern. Do not supply this parameter if you want the entire image to be examined.

Example

Pattern Matching Example
Fuse Inspection Example

See Also

MatchPattern2

LearnPattern

CWIMAQMatchPatternOptions

CWIMAQRectangle

LearnColorPattern

MatchColorPattern