LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2d cross-correlation (for image correlation): some questions

With some help from developer zone, I put together a VI to perform 2d cross-correlation just using LabVIEW (and not IMAQ VISION) fxs. What I am looking to do is compute a "normalized" cross-correlation maximum (normalized to 1) by:

1) first computing cross-correlation maximum of two identical images followed by
2) cross-correlation of two different images (one of which is the image used in step 1) to obtain cross-correlation maximum and
3) dividing the cross-correlationi maximum of step 2) into that of step 1).

I have an option in this VI to use a subset image. When I use a subset image, I actually obtain a normalized cross-correlation maximum greater than 1. I don't see how this is possible an
d it is unclear to me as a result whether my code / computation methods are correct. I was wondering if someone might be able to take a look at this.

Thanks,

Don
0 Kudos
Message 1 of 8
(8,756 Views)
Don,

Thank you for posting your question on the forum. I have spent some time looking at your code to see if something in LabVIEW or from your coding jumped out at me as causing the problem. Everything looks very clean, and, having not looked at my statistics or correlation functions in a while, I did not see anything obviously wrong.

One thing I did notice is that if you select a different subset, such as 0 to 100, then the normalized correlation does come in at less than 1. Because of this, it leads me to believe that there may just be something slightly wrong with the code and the steps you are doing.

Again, from a programming standpoint it looks just fine, and maybe someone else out here who deals with statistics and correlation more often may be
able to shed some light on the math side of your application.

Regards,
Michael
Applications Engineer
National Instruments
0 Kudos
Message 2 of 8
(8,756 Views)
Hi Michael:

Thanks for looking at this for me. The other issue is that when I use the IMAQ VISION cross-correlation fx (which allows me to do direct image correlations without having to do the fft steps), I get different answers than what I get with my LabVIEW routines. I believe that most of this just has to do with scaling but because I cannot see the 'c' code of any of the routines, I am not sure. I tend now to trust the IMAQ VISION routine more because when i correlate two identical U8-format images, I get a cross-correlation maximum of 256 (which I expect to be the maximum possible value for a U8 type image). Then when I correlate two non-identical images, or use subset images, I always get less than this for the maximum. My goal was to impleme
nt this procedure without IMAQ Vision since that is the only place I would need Vision for this code. I would appreciate it if you might be able to have one of your math gurus right at NI take a look at this. Any chance of this?

thanks,

Don
0 Kudos
Message 3 of 8
(8,756 Views)

Hi,

 

maybe this could help..This is a part of my thesis code..

some of the vi was downloaded here in the ni furom..

 

Try this and hope it solves your doubts..

 

 

 

 

0 Kudos
Message 4 of 8
(8,090 Views)
Wow, this is an old thread resurrected!  Just to try to tie some threads together, the code published here is not "Normalized" cross-correlation - even if it gives a maximum value of one. This thread and this one talk a bit more about cross-correlation, especially fast normalized cross-correlation which is described by Lewis (1995) "Fast Normalized Cross-Correlation" (PDF link).  I wrote a 2D normalised cross-correlation routine baed on this which you can find there.

 

Cheers ~ Greg

 

Message 5 of 8
(8,076 Views)

Hello,

 

Can you send to me your programm i couldn't downald it from here ?

Thank you

0 Kudos
Message 6 of 8
(4,081 Views)
Message 7 of 8
(4,076 Views)

Thank you very much 🙂 that will help me.

0 Kudos
Message 8 of 8
(4,065 Views)