MatchPattern2 Method

NI Vision for Visual Basic

MatchPattern2 Method

Syntax

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

Return Type

Long

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

Purpose

Searches for a pattern, or template image, in the input Image. Use LearnPattern2 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 LearnPattern2.

MatchPatternOptions As CWIMAQMatchPatternOptions

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

LearnPattern2

CWIMAQMatchPatternOptions

CWIMAQRectangle

LearnColorPattern

MatchColorPattern