Jump to content

Error in implementing IMAQ IFFT


Recommended Posts

Even though the Help docs are not very clear, I'm pretty sure that the Inverse FFT takes a complex Src image and returns a grayscale Dst image.  So does it work if you change im1 to be a Complex image (and use the ArrayToComplexImage VI), and change im2 to be a U8 image (though I think this will get automatically set)?

  • Like 1
Link to comment

Even though the Help docs are not very clear, I'm pretty sure that the Inverse FFT takes a complex Src image and returns a grayscale Dst image.  So does it work if you change im1 to be a Complex image (and use the ArrayToComplexImage VI), and change im2 to be a U8 image (though I think this will get automatically set)?

Thnx Greg.. You got it right.

 

Although I got the output wrong.  Can you tell me how to extract magnitude from the  output image

Link to comment

"Magnitude" only makes sense in terms of a Complex image, and there is a VI for extracting that.  The output image is a grayscale U8 image, and so doesn't have a magnitude.  Can you explain more of what you're trying to do?

Hey Greg.. In my project I have to capture a interference pattern(hologram of an object) using a CCD & that hologram image  is processed numerically to get back the image .The image of vi's and code is attached and in the code R(k,l) is taken as 1 and h(k,l) is the input image.Can you ensure what I have done is right...

   Thnx for your time

post-52393-0-09045800-1406167935_thumb.p

post-52393-0-51593800-1406167937_thumb.p

post-52393-0-95940200-1406167938.png

Link to comment

Couple of obvious things to start with.

  1. The equation looks rather like a convolution, which is equivalent to a multiplication in the Fourier domain.  So at the very least, you need to take the FFT of your image before multiplying it with your Exponential array, and then computing the Inverse.  
  2. In your upper For loop (which I presume is the subVI with an arrow on it) it looks as though you're trying to compute the matrix corresponding to the first exponential.  Your equation defines an N x N array (not k x l array) in which k and l vary from 0 to N-1 (effectively they are a frequency domain analog of your image pixel positions, and the image should also be of size N x N).  Your code does something quite different.  You can also move many of the constants (anything not changing during the loop iteration) outside the loop, including the final Exponential, which will work just as happily, and usually faster, on a 2D array.
  • Like 1
Link to comment

Greg.. I got some interesting results by implementing your suggestions(taking FFT before multiplication) in my code.

Now I have to do some image processing too. Can you Please provide me some helpful links..

 

I realized the error in for loop but couldn't correct it (some basic confusions) and I'm posting the VI 

 

 

Thank you very much Greg for your support

retrying exp part.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.