FFT图像比较(理论)
有人能解释一下(简化的)如果我用 FFT 进行图像比较会发生什么吗?我不知何故不明白如何将图片转换为频率以及如何使用它来区分两个图像。通过谷歌,我找不到我(作为非数学/信息学)可以理解的简单描述。
任何帮助将非常感激! 谢谢!
Can anybody explain me (simplified) what happen if I do an image comparison with FFT? I somehow don't understand how it's possible to convert a picture into frequencies and how this is used to differentiate between two images. Via Google I can not find a simple description, which I (as non mathematic/informatic) could understand.
Any help would be very appreaciated!
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
唉,对 FFT 的良好描述可能涉及复变量微积分和递归算法的计算理论等主题。所以简单的描述可能不是很准确。
想想声音。查看两位歌手发出的声音波形可能不会告诉您太多信息。这两个波形只是一个复杂的长而凌乱的波浪线。但频率计可以很快告诉你一个人的演唱偏离了音调,以及他们是女高音还是男低音。因此,您也许能够根据频率计读数确定某些波形与唱歌者不匹配。
FFT 就像一大堆频率计。照片的每条扫描线都是一个波形。
大约两个世纪前,一个名叫傅里叶的人证明,任何看起来合理的波形曲线都可以与一组适当的正弦波相匹配,每个正弦波都有一个频率。几十年前,其他人想出了一种非常聪明的方法,可以快速计算出那是哪一束正弦波。快速傅里叶变换。
Alas, a good description of an FFT might involve subjects such as the calculus of complex variables and the computational theory of recursive algorithms. So a simple description may not be very accurate.
Think about sound. Looking at the waveform of the sound produced by two singers might not tell you much. The two waveforms would just be a complicated long and messy looking squiggles. But a frequency meter could quickly tell you that one person was singing way off pitch and whether they were a soprano or bass. So you might be able to determine that certain waveforms did not indicate a good match for who was singing from the frequency meter readings.
An FFT is like a big bunch of frequency meters. And each scan line of a photo is a waveform.
Around 2 centuries ago, some guy named Fourier proved that any reasonable looking waveform squiggle could be matched by an appropriate bunch of just sine waves, each at a single frequency. Other people several decades ago figured out a very clever way of very quickly calculating just which bunch of sine waves that that was. The FFT.
离散 FFT 将像素值的(2D)矩阵转换为频域中的 2D 矩阵。您可以使用像 FFTW 这样的库将图像从普通形式转换为光谱形式。比较的结果取决于您真正比较的内容。
傅里叶变换也适用于二维以外的其他维度。但您会对 2D FFT 感兴趣。
Discrete FFT transforms a (2D) matrix of let's say, pixel values, into a 2D matrix in frequency domain. You can use a library like FFTW to convert an image from the ordinary form to the spectral one. The result of your comparison depends on what you really compare.
Fourier transform works in other dimensions than 2d, as well. But you'll be interested in a 2D FFT.