LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT of an image

Solved!
Go to solution

Hello

I have an image of size M X N (pixel).

Fisrt of all i have read the image from the path location. Then I used Unflatten Pixmap VI to convert the image to array. Now i need to find the 2 D FFT. I have to do the FFT by fist computing the transforms of the rows in parallel and then the transforms of the columns of the result. For that i extracted the N Resolution value and gave it to ta for loop ( since there are N rows for the image.) Then I calculated the FFT for these rows. The resulting array is transposed to do the FFT for the columns. Is the VI i made  correct? Please see the attchement for the image.

How can i get the 2D- FFT plot ?

 

Thankss

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
Message 1 of 9
(7,223 Views)
Solution
Accepted by topic author Nghtcrwlr

you've got the right idea. see the attached vi for an illustration of an intensity graph of the fft and the inverse 2D fft and picture displays.

 

-root

 

 

Message Edited by Root Canal on 11-11-2008 02:25 PM

global variables make robots angry


Download All
Message 2 of 9
(7,188 Views)

Hello Root

 

Thanks. I had a bit problem in retriving the real part of FFT and plotting it and now its done.  Another question i have is is it possible to map the FFT sample in cartesian coordinates to Polar coordinates. I tried to take the Re & Im values from the FFT > converted it to Polar > made it in to an array an plotted to a polar graph. But when i connec the appended array to polar graph,there comes an error with the conflict in array dimensions. Why is it so?

 thanks

 

 

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 9
(7,175 Views)
Note that the FFT.vi in LabVIEW 8.5 (likely was available a few versions back) allows you to select to do a 2d FFT and I expect it is faster than doing the 1d FFT twice with transposition.....Don
Message Edited by DonRoth on 12-19-2008 03:06 PM
Message 4 of 9
(7,005 Views)

In fact, all 6 of the FOR loops can be easily eliminated (and that while loops need e.g. an event structure or at least a wait.):

 

 

 

Message Edited by altenbach on 12-19-2008 03:58 PM
Message 5 of 9
(6,991 Views)
What was odd to me was that he did the 2d inverse FFT but did not do the 2d forward FFT at the front end (like you show).....Don
Message Edited by DonRoth on 12-20-2008 12:19 PM
Message Edited by DonRoth on 12-20-2008 12:20 PM
0 Kudos
Message 6 of 9
(6,960 Views)

What was odd to me was that he did the 2d inverse FFT but did not do the 2d forward FFT at the front end (like you show).....Don

 

What do you mean "did not do the 2d forward FFT"? You mean the forward FFT VIs did not show polymorphic selectors like inverse FFT VIs did? 

There is a polymorphic VI selector for inverse FFT VI because the input of this VI are always complex for both real inverse FFT and complex inverse FFT, the user must select real or complex instance himself. But for forward FFT, the polymorphic VI will select appropriate instance automatically. As a result, polymorhpic VI selector is unnecessary.

 

 

0 Kudos
Message 7 of 9
(6,870 Views)

pine wrote:

What do you mean "did not do the 2d forward FFT"? You mean the forward FFT VIs did not show polymorphic selectors like inverse FFT VIs did? 


The forward FFT was done with 1D arrays and two for loop, while the reverse fft was done on the 2D array.

 

(The comment had nothing to do with polymorpic selectors, but with the puzzling question why the forward fft was not done on the 2D array directly.)

0 Kudos
Message 8 of 9
(6,863 Views)

Here is a simple program that performs frequency filtering of an image using the forward and reverse FFT transforms. I've saved a native 8.6 version and attempted to save an 8.0 version. I suspect the 8.0 version will not work properly because LabVIEW acted flakey when saving it out. The main VI is called "FFT madness RUN ME.vi"

 

 

Message Edited by Root Canal on 01-12-2009 12:43 PM

global variables make robots angry


Message 9 of 9
(6,739 Views)