04-17-2009 04:01 PM
So, I've identified two major bugs in IMAQ correlate which make it unusable for my application (see post at http://forums.ni.com/ni/board/message?board.id=170&message.id=401078#M401078 for details concerning the bugs in IMAQ Correlate). Does anyone have a dll or C++ source code for normalized cross correlation that I could use instead?
-root
Solved! Go to Solution.
04-19-2009 04:26 PM - edited 04-19-2009 04:29 PM
Have you tried using the CrossCorrelation VI under Signal Processing? Alternatively it may not be too hard to roll your own based on IMAQ FFTs, for example:

You'll obviously need to zero-pad your images if they're not the same size already.
Cheers ~ Greg
04-20-2009 10:57 AM
Unfortunately, I need the normalized cross correlation. Although cross correlation can be efficiently implemented in the transform domain, the normalized
form of cross correlation preferred for image feature matching does not have a simple frequency domain expression. Oddly, it appears that the CrossCorrelation VI in the signal processing palette does not contain the functionality to produce a normalized cross correlation for a 2D array.
-root
04-22-2009 05:33 PM
Sorry, I misunderstood. I haven't needed Normalized CC in the past, but I had a quick look at what might be required. The best reference I found was Lewis (1995) "Fast Normalized Cross-Correlation" (PDF link) which implements it using Sum Tables. If I get a chance, I'll see if I can code it up (doesn't look too difficult) - but probably using arrays rather than images so that it's reusable for 3D images. It appears that the numerator of the NormCC can still be computed in the frequency domain, and the sum tables speed up the computation of the denominator.
Cheers ~ Greg
04-22-2009 07:13 PM - edited 04-22-2009 07:16 PM
04-22-2009 08:32 PM
I've coded the Normalized Cross-Correlation anyway - here it is if you're interested. It's not much slower to compute the normalization using this method. If it seems useful, you're welcome to use it. Extending it to 3D would be straightforward as well. With 3D, I'm not doing hyperspectral imaging, just 3D confocal imaging.
Cheers ~ Greg
04-23-2009 01:19 PM
Nicely done! It seems that for large images and templates, the only reasonably efficient technique is one such as this.
-root
07-27-2009 10:43 PM
Hello Folks,
I am working on a project to determine strain measurements for Biaxial Tension sytem for any given sheet metals. Using labview, I have written a simple application for calculating stress-strain curves from images taken on our Biaxial system. And now I would like to extend my work to two camera system (sterioscopic). I was reading about Digital Image Correlation techniques, but couldn't progress much and I also think my basic understanding of Cross-Correlation techniques is not that good. I would really appreciate if you folks can point me to some right direction i.e. basic concept, articles, some examples using image analysis etc. The idea is to where I should start and which path of learning to follow?
Thanks.
Hansa
07-28-2009 05:34 PM
Hello Hansa,
For explanation of the concept of normalized cross-correlation using NI's algorithms, I would look at the Vision Concepts Manual (\Program Files\National Instruments\Vision\Documentation). Page 12-5 to 12-7 might have some information of interest to you. There are no built-in functions for stereoscopy in NI Vision, but you should be able to implement a custom algorithm in LabVIEW.
Here is a developer zone article that explains general image analysis and processing techniques:
I hope this helps.
07-28-2009 10:42 PM
Hello Vivek,
Thanks for the reply. But the enclosed reference to Image processing does not work. Kindly post the link again.
Thanks.
Hansa