10-15-2008 10:06 PM
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).
Solved! Go to Solution.
10-17-2008 09:51 AM - edited 10-17-2008 09:52 AM
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
10-18-2008 10:27 AM
10-18-2008 10:55 AM
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.vicrop 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.
10-20-2008 08:39 AM
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
10-21-2008 11:27 AM
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
02-05-2009 09:47 AM
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..
08-10-2014 11:25 PM
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.