sreekanth Posted July 22, 2014 Report Share Posted July 22, 2014 While implementing inverse Fourier Transform an error pops out and I don't know how to solve it .The image of VI is attached. Please help me. Quote Link to comment
GregSands Posted July 22, 2014 Report Share Posted July 22, 2014 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)? 1 Quote Link to comment
sreekanth Posted July 23, 2014 Author Report Share Posted July 23, 2014 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 Quote Link to comment
GregSands Posted July 23, 2014 Report Share Posted July 23, 2014 "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? Quote Link to comment
sreekanth Posted July 24, 2014 Author Report Share Posted July 24, 2014 "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 Quote Link to comment
GregSands Posted July 24, 2014 Report Share Posted July 24, 2014 Couple of obvious things to start with. 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. 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. 1 Quote Link to comment
sreekanth Posted July 25, 2014 Author Report Share Posted July 25, 2014 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.