I try to obtain the spectrum of an grayscale image using FFT Cooley–Tukey algorithm in Java. I don't know exactly how to form the input for the algorithm and what values from the output to use in order to form the spectrum image.
Currently my input is an array of complex numbers, with Re = value of the pixel in 8bit grayscale domain and Im = 0; After running the algorithm I obtain another array of complex numbers with the real part having a lot of values out of [0,255] range and imaginary part 0. I have tried to create an image from the real numbers array modulo 256.
This is how the spectrum should look:
And this is what I've got:
Obviously I'me doing something terrible wrong but I don't know what.