Correlate Method

NI Vision for Visual Basic

Correlate Method

Syntax

CWIMAQVision.Correlate SourceImage, PatternImage, DestImage, Left, Top, Width, Height

Return Type

Long

The source image. The correlation modifies the border of the source image. The border must be at least half as large as the larger dimension of the template image.

Purpose

Obsolete—Use Correlate2 instead. Computes the normalized cross correlation between the source image and the template image.

Remarks

This method modifies the source image. If you need the original source image, create a copy of the image using the CWIMAQVision.Copy method before using this method.

Use this method with U8 images. This method is optimized for MMX. However, MMX optimization is valid only when the width of the template image is a multiple of 4.

Correlation is a time-intensive operation. You can reduce the time required to perform a correlation by keeping the template size small and reducing the search area in the source image with the Left, Top, Width, and Height parameters.

Parameters

SourceImage As CWIMAQImage

The source image. The correlation modifies the border of the source image. The border must be at least half as large as the larger dimension of the template image.

PatternImage As CWIMAQImage

The template image to correlate against the source.

DestImage As CWIMAQImage

The resulting 8-bit image containing the cross correlation values normalized to lie in the range [0, 255]. A value of 255 indicates a very high correlation and a value of 0 indicates no correlation.

Left As Long

The left edge of the search rectangle in the source image.

Top As Long

The top edge of the search rectangle in the source image.

Width As Long

The width of the search rectangle in the source image.

Height As Long

The height of the search rectangle in the source image.

See Also

Correlate2