Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How does the IMAQ Correlate function work?

We're using the IMAQ Correlate function (from Vision 7.0) to compare 2 images of the same size to determine how "alike" they are. Since IMAQ Correlate uses a CIN it is impossible to see which algorithm being used for the correlation.

What algorithm does the IMAQ Correlate function use for the cross correlation? How does it work? Is the correlation a point-by-point (i.e. pixel-to-pixel) correlation or a region-of-interest to region-of-interest comparison? Any comments are greatly appreciated. Also, possible references for the algorithm's description would be helpful as well.
0 Kudos
Message 1 of 4
(3,688 Views)
Thank you for contacting National Instruments. The best place to start to get a better understanding of the Vision functions is to look in the IMAQ Vision Concepts Manual. This manual, along with other documentation, should already be installed on your computer. You can find them by clicking on the Start button in windows and navigating the National Instruments >> Vision >> Documentation section.

In that manual starting at page 12-7, you will find a more in-depth discussion of cross-correlation and the formulas used than the Help in LabVIEW provides. The equations and illustration provided in the manual will give you the exact algorithm and method used.

Hopefully this will help answer your question, but if this does not fully solve your problem then let us know
along with any other questions or comments.

Regards,
Michael
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,688 Views)
Michael

Thank you for the information. Can you comment on whether we are using the function properly? The description in the manual implies that one of the images should be smaller than the other. Currently we're using the IMAQ Correlate function to compare 2 images of the same size to determine how alike they are.

Also, can you comment on the output of the function and how it should be interpretted?

Thank you,
Laura
0 Kudos
Message 3 of 4
(3,688 Views)
Hello Laura,

Here is a good KnowledgeBase of when to use the Correlate function when pattern matching: How Do I Match Patterns or Shapes in IMAQ Vision. Here it talks about comparing a whole image with a smaller, template image. With IMAQ Correlate, higher values are left behind when the image is a close match.

Though your use of the Correlate function is correct, it may not be the best for your application. Something that I typically do when comparing two images is an operation on the two images, like a subtraction of one from the other. One operation that I find works best is the Exclusive Or (XOR). When comparing two images with this
function, anything that is different will be left behind. If the two images are exactly the same, then the image output would be totally black.

Hope this helps,
BB_Phil
0 Kudos
Message 4 of 4
(3,688 Views)