Saturday, 15 January 2011

java - What should be the input and output for an FFT image transformation? -



java - What should be the input and output for an FFT image transformation? -

i seek obtain spectrum of grayscale image using fft cooley–tukey algorithm in java. don't know how form input algorithm , values output utilize in order form spectrum image.

currently input array of complex numbers, re = value of pixel in 8bit grayscale domain , im = 0; after running algorithm obtain array of complex numbers real part having lot of values out of [0,255] range , imaginary part 0. have tried create image real numbers array modulo 256.

this how spectrum should look:

and i've got:

obviously i'me doing terrible wrong don't know what.

you did not provide source code ...

your result looks resolution tree

used recursive resolution/frequency info scaling , feature extraction not fft !!! so may recursion wrong or overlap info (to code inplace fft insanity) you should start 1d transform , utilize 2d and visually check every stage (also inverse transform match original data)

your fft output should have non 0 imaginary part !!!

look here how compute discrete fourier transform and sublinks in reply of mine

is image resolution exact powerfulness of 2?

if not 0 pad or fft not work properly

your illustration wrong

this how looks in real: left input image (copied question) middle real part right imaginary part you can combine them powerfulness spectrum =sqrt(re*re+im*im) the re , im image amplified seen else few white dots in corners vissible here more examples: your expected result looks shifted half of image resolution (so center of symmetry in center of image instead of in corners)

[edit1] powerfulness , wrap

have added powerfulness , wrap functions mine app here result first powerfulness computed intensity=sqrt(re^2+im^2) and wrap done shifting image half size right , down what overlapping comes other side back so swap points in lines swap((x,y),(x+xs/2,y)) and same columns swap((x,y),(x,y+ys2/2)) now result matches 1 op the app here

java image-processing fft noise-reduction noise-generator

No comments:

Post a Comment