imaqCorrelate
Usage
int imaqCorrelate(Image* dest, Image* source, const Image* templateImage, Rect rect);
Purpose
Computes the normalized cross-correlation between a source image and a template image. This operation is time-intensive. To reduce the correlation time, use a small template, reduce the search area by using the area rectangle, and make the template image width a multiple of 4.
Image Types Supported
IMAQ_IMAGE_U8
Parameters
Name
|
Type
|
Description
|
---|---|---|
dest | Image* | The destination image. |
source | Image* | 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. |
templateImage | const Image* | The template image to correlate against the source. |
rect | Rect | The area of the source image on which to perform the correlation. Set this parameter to IMAQ_NO_RECT to perform the correlation on the whole source image. |
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
source—This function modifies the source image. If you need the original image, create a copy of the image using imaqDuplicate() before using this function.