【发布时间】:2014-12-10 15:09:16
【问题描述】:
我实现了一种使用高斯模糊图像的方法,如下所示:
- image I , size = WxH
- kernel K , size = MxM
- padded the kernel PD to the size of the image
i.e for an image 5x5 and a kernel 3x3 after padding the kernel looks like:
0 0 0 0 0
0 x x x 0
0 x x x 0
0 x x x 0
0 0 0 0 0
where X is the value from the original kernel
- performed 2d fft on the padded kernel PD (FFT_K)
- performed 2d fft on the image I (FFT_I)
- multiplied FFT_I * FFT_K (FFT_RES)
- perfomed fft on FFT_RES
- shifted the FFT_RES (RESULT)
结果在边缘包含一些锯齿。
结果如下:
如果您注意到正确的图像,您会看到它在两个维度上都有别名。
上述算法正确吗?
使用 C++ 和 fftw3 实现。
【问题讨论】:
-
只是确认,对于 3x3 内核,“锯齿”(实际上很可能不是)在前 2 个像素内,对吗?
-
其实,我要把这个猜测作为答案
标签: c++ image-processing signal-processing