为什么在FFT自相关的情况下AForge.net提供不同的输出?

时间:2018-07-25 13:01:49

标签: c# image-processing convolution aforge

请参阅此related question

我想使用 AForge.net 框架获得相同的结果。输出应符合以下条件:

enter image description here

输出似乎不符合预期:

为什么AForge.net中的输出不同?

源代码

$("#menubar").click(function myfunction() {
   $("#menubar").off("click", this.click);
                $.deneme()
            }

2 个答案:

答案 0 :(得分:2)

主要问题是

    ComplexImage cKernel = ComplexImage.FromBitmap(image);
    //cImage.ForwardFourierTransform(); //<--- This line should be FFT of cKernel
    cKernel.ForwardFourierTransform();

这将解决您在生成的图像中提到的问题,但是如果要获得与右下角图像相似的图像,则需要进行一些归一化处理以增加像素强度。


更新: 右下方的图像实际上是傅立叶图像,因此我认为我们应该删除BFF。

//convOut.BackwardFourierTransform();

答案 1 :(得分:0)

似乎您没有在Aforge中使用高斯内核, 无论如何,该库都有一种与高斯卷积的方法:

int w=4,h=11;
GaussianBlur filter = new GaussianBlur( w, h );
// apply the filter
filter.ApplyInPlace( image );

尝试一下,输出应该与其他输出相同。

相关问题