I have a problem when I try a FFT filter on an image . The input is the pgm file format (b&w). The result image ain’t correct . The right one should look like this this . Don't mind the colors :)
For more detail please see the code. It ain’t clean ; sorry ; I’m working on it. A few steps in my program. I doubt step 3 and 5 the most . The FFT function (step 4) from Paul Bourke should be fine
1- read pgm file into an ‘image’ struct
2- create a 2d array of ‘Complex’ struct
3- pass values from the image to Complex.Real ( Maybe a problem about convert integers to doubles ; but I ain’t think it’s a trouble )
4- call the 2dFFT function
5- Read data from ‘Complex’ array and pass values to ‘image’ struct to display (The problem maybe I filter the result to fit the pgm format –convert double to integer ; then fit them into the range from 0 to 255)