I’m looking to get the complex pixel values from an Image. Am I correct in saying that if I perform a Fourier transform on an image that the pixel data of the returned image is the complex pixel data of the original image. If i’m wrong, how to i get the complex pixel data of an image.

Good day Brian,

an image doesn’t have complex values, a 2D signal may have complex values.

So the first question is: Where do your images originate from?

If they come from cameras or other electro-optical devices, they are real-valued.

If however, you do a Fourier-transform of an image, the result will generally be a complex-valued 2D signal. In ImageJ-1 such signals are represented as stacks consisting of two slices. The first containing the real part, the second containing the imaginary part.

HTH

Herbie

Hi Herbie, yes the image is a snapshot from a camera. I’m trying to write a java method which takes the Image’s pixel data, then makes two arrays, one for the real and one for the complex values.

So using ImageJ-1 I take the FFT of the image, them get each slice of the stack and copy the pixel data from each slice into its array?.

Thanks for the reply.

Dear Brian,

it would be of great help to know what you really want to do and why you are interested in complex values of an image that, as explained before, do not exist.

The Fourier-transform of an image is completely different from the underlying image. So please tell us what is so important with complex numbers and images.

BTW, each of the two slices of the complex-valued Fourier-transform (of an image) is in fact an array and of course an image itself is an array too. So why do you want/need to copy pixel data?

You may save an image as text image which actually is an array of numbers in text form.

Clueless,

Herbie

Hi, sorry if I wasn’t clear, its part of a college project i’m doing. One part of my project is to take an image, get the real and imaginary parts of the images pixel data into two seperate arrays, take the arrays and perform the Amp and phase equations on the arrays, sqrt( real^2 + img^2) for Amp, and tan^-1(real/img) for the phase , then reconstruct the new Amp and Phase arrays into images.

Sorry too, Brian!

The main problem with your project is that an image is real-valued and has neither real and imaginary part nor modulus and phase!

If you mean the Fourier-transform of an image, then you are dealing with something rather different from the underlying image.

But even if you mean the Fourier-transform of an image and you represent its real and imaginary part as modulus and phase, then you must write a Fourier-re-transformation that accepts Fourier-spectral modulus and phase as input in order to regain the original image.

Still not sure where you want to go.

Best

Herbie

Hi Herbie, thanks for replying. I’m having trouble getting my idea and explanation across because I’m not fully sure on what I’m trying to do myself. But thanks for helping.