FFT实现 [英] FFT implementation

查看:327
本文介绍了FFT实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 FFT 来增强图像的应用程序。

I am working on application to enhance an image using FFT.

我已经实现了<的代码code> 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?

已编辑

我已尝试在Catalano框架上使用建议的指纹功能图片。
应用Catalano框架后的输入图像和输出图像:

I have tried with suggested functions in Catalano framework on the fingerprint image. Input image and output image after applying the Catalano framework :

输入图像

傅里叶变换

频率过滤器

输出

当我在指纹图像上应用时,输入图像和输出图像之间的差异并不那么有效。即使在应用FFT之后,指纹图像中的脊和山谷之间的对比也无法明显区分。所以有任何在指纹上进行操作所需的附加参数图片?

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?

推荐答案

您可以使用 Catalano Framework

请参阅下面的代码和结果。

See the code below and the results.

FastBitmap fb = new FastBitmap("c:\\files\\test.bmp");
fb.toGrayscale();
JOptionPane.showMessageDialog(null, fb.toIcon(), "Image", JOptionPane.PLAIN_MESSAGE); 

FourierTransform ft = new FourierTransform(fb);
ft.Forward();
fb = ft.toFastBitmap();
JOptionPane.showMessageDialog(null, fb.toIcon(), "Fourier Transform", JOptionPane.PLAIN_MESSAGE);

FrequencyFilter ff = new FrequencyFilter(0, 60);
ff.ApplyInPlace(ft);
fb = ft.toFastBitmap();
JOptionPane.showMessageDialog(null, fb.toIcon(), "Frequency Filter", JOptionPane.PLAIN_MESSAGE);

ft.Backward();
fb = ft.toFastBitmap();
JOptionPane.showMessageDialog(null, fb.toIcon(), "Result", JOptionPane.PLAIN_MESSAGE);

这篇关于FFT实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆