Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have the following code

Image[img, ImageSize -> 300]
data = ImageData[img];
fdct = Fourier[data]
tdata = InverseFourier[fdct];
Image[tdata]

but it seems to fail when doing the inverseFourier function. The error I get is:

Image::imgarray: The specified argument {{{1. -2.0236*10^-17 I,1. -9.36654*10^-17 I,1. -3.45228*10^-17 I},<<49>>,<<330>>},{<<1>>},<<47>>,{{1. +4.61893*10^-17 I,<<19>> +<<24>> I,1. +7.44929*10^-17 I},<<49>>,<<330>>},<<330>>} should be an array of rank 2 or 3 with machine-sized numbers. >>

I'm actually not sure what I'm doing wrong as I've checked the "discrete fourier transforms" (http://reference.wolfram.com/mathematica/tutorial/FourierTransforms.html) and the output of fourier was just used in the inverseFourier to get the inverse...

Any ideas what is wrong here?

share|improve this question
    
Seems like you're right... Chopping values of solved the issue. –  markovuksanovic Jul 27 '13 at 7:26
add comment

1 Answer 1

up vote 1 down vote accepted

tdata acquired small imaginary parts. Try

Image[Chop@tdata]

instead.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.