Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

fft cross correlation

Solved!
Go to solution

Hi everyone!!

 

I am a graduating student and  have to make a research project. I have to calculate the displacement field and strain distribution from undeform  to deformed speckle images from loaded sample..To calculate these parameters, I have to use cross correlation or preferably usinf FFT method. I have some problem regarding cross corellation using FFT method. I created a program with some help from furoms posted.

 

I extract 32x32 pixels from the undeform and deformed speckle images and pad it with there mean intensities. Also I removed DC component of the sub-images by subtracting intenties to there mean intensity  and try to calculate cross correlation using FFT method.

 

Refering to the book i've read, the location of the maximum peak gives the relative displacement between the two images. However, the result of my program, the location of the maximum peak will always at the coordinates (x=0,y=0) so this means that there was no relative displacement between the two images.

 

Why is this so?? Pls help me..

 

Attached is my program created and a subvi for padding and a sample of the images( loaded sample).

Download All
0 Kudos
Message 1 of 8
(6,131 Views)

Hi laudz,

 

I looked through your code, and made a couple of changes, including a graph of the complex and real parts of your output on separate graphs. I'm not sure how the conversion to dynamic data handled the complex array. 

 

I've reattached your code and included the CrossCorrelation VI as well. This may do what you want to do, but you don't have control over how the cross correlation is calculated, beyond switching between direct and frequency domain (FFT). Check out the Labile help for the VI to see how it computes the cross correlation.

 

Hope this helps,

 

~Nate 

 

 

Message Edited by N_Holmes on 10-17-2008 09:52 AM
Message 2 of 8
(6,095 Views)
Message 3 of 8
(6,079 Views)

I also made some changes and this time my program works. I tried images that i downloaded from this forums (which is a stretched metal) and implement my new program to get the relative displacement between the two sub images. This time i get the relative displacement between the two sub-images and the result seems correct.

 

Using my new program created, i tried it with my stretched metal blade (images attached from my 1st post message) but the peak is always at the coordinates (x=0, y=0), which means there was no relative displacement between the two sub images. I also tried sub-images at different location from the stretched metal blade, but the result was the same.

 

 

But i tried subtracting the two images and i get a correlation fringes, which means there is a displacement happen.  Why is this so?? Are my images captured are decorrelated?? If my images were decorrelated, i would not get correlation fringes when i subtracted undeformed to deformed loaded specimen images. 

 

Suggestions and comments are greatly appreciated.

 

Attached is my new program created and the images I downloaded from these forums.

 Final_32x32_padding.viFinal_32x32_padding_subvi.vi

crop images . zip

 

In crop images, a and b are the crop images from my stretched metal blade and before, after0 and after1 are the images I downloaded.

 

 

Message 4 of 8
(6,074 Views)

Hi Nate,

 

Thanks for helping me..By the way, the code that you have change cannot run in my Labview 7.0 cause you are using 8.0 version, i think.

 

I can't implement the code you have changed..

 

I made some changes in my program, hope im in a right track..

 

 

Laudz

 

 

0 Kudos
Message 5 of 8
(6,033 Views)
Solution
Accepted by laudz

Dear Laudz,

 

I tried to save back to 7.0, but you may find that some subVIs are missing. I hope you are able to replace them on your end. It looks like you are on the right track.

 

Good Luck with the rest of the application!

 

~Nate

 

 

Message 6 of 8
(6,008 Views)

For those who view this post:

 

I already made the code for calculating the cross correlation of two images using FFT. For those who are intersted, just post here..

0 Kudos
Message 7 of 8
(5,653 Views)

Hii Laudz,

 

I made the code for cross correlation using FFT. I have given two sine waves and getting some output. Now i did the same thing using Cross Correlation Vi available in labview. But both the techniques are showing different outputs. why is it so?? Can you please send me Cross correlation code using FFT that u made so that i can cross check.

0 Kudos
Message 8 of 8
(3,714 Views)