I am working on application to enhance an image using FFT
.
I have implemented the code for FFT
:
For the first formula in above picture i have implemented code as below :
void fft(int x , int y , int size) {
for(int i=x; i<x+32 ; i++){
for(int j=y ; j<y+32 ; j++){
double kth = -2 * Math.PI * (((i*x)/size)+((j*y)/size));
ComplexNumber expo = new ComplexNumber(Math.cos(kth),Math.sin(kth));
output.values[i][j] = ComplexNumber.cMult(input.values[x][y],expo) ;
intermediate.values[i][j] = output.values[i][j];
input.values[i][j] = output.values[i][j];
}
}
}
I have also implemented code for second and third formula but the result I am getting is not correct. What should I do ?
Is the code implemented for the first equation correct?
Edited
I have tried with suggested functions in Catalano framework on the fingerprint image. Input image and output image after applying the Catalano framework :
Input Image
Fourier Transform
Frequency Filter
Output
As I am applying it on fingerprint image the difference between input image and output image is not so effective.The contrast between ridges and valleys in the fingerprint image is not clearly differentiable even after applying the FFT.So is there any addition parameters needed to do operation on fingerprint image?
You can use Catalano Framework.
See the code below and the results.
you can use FFT in java as follow:
This link is dead (http://blog.datasingularity.com/?p=53)
http://introcs.cs.princeton.edu/java/97data/FFT.java.html
and refer the info for FFTW is the 'fastest fourier transform in the west', and has some Java wrappers: from http://www.fftw.org/download.html