我正在尝试对灰度图像实施高斯模糊。但我确实发现 GIMP 的高斯模糊过程的输出和我的有区别。
如上图所示,左边是 GIMP 的输出,右边是我的。并且GIMP的图像更精细。
我在左图使用了 GIMP Gaussian 的 7x7 水平和垂直模糊半径。和由 7x7 高斯模糊系数制成的右图。
A00 = 0.000036; A01 = 0.000363; A02 = 0.001446; A03 = 0.002291; A04 = 0.001446; A05 = 0.000363; A06 = 0.000036;
A10 = 0.000363; A11 = 0.003676; A12 = 0.014662; A13 = 0.023226; A14 = 0.014662; A15 = 0.003676; A16 = 0.000363;
A20 = 0.001446; A21 = 0.014662; A22 = 0.058488; A23 = 0.092651; A24 = 0.058488; A25 = 0.014662; A26 = 0.001446;
A30 = 0.002291; A31 = 0.023226; A32 = 0.092651; A33 = 0.146768; A34 = 0.092651; A35 = 0.023226; A36 = 0.002291;
A40 = 0.001446; A41 = 0.014662; A42 = 0.058488; A43 = 0.092651; A44 = 0.058488; A45 = 0.014662; A46 = 0.001446;
A50 = 0.000363; A51 = 0.003676; A52 = 0.014662; A53 = 0.023226; A54 = 0.014662; A55 = 0.003676; A56 = 0.000363;
A60 = 0.000036; A61 = 0.000363; A62 = 0.001446; A63 = 0.002291; A64 = 0.001446; A65 = 0.000363; A66 = 0.000036;
pBlurData[i*rwsize + j] =
A00*(double)pTempData[(i - 3)*rwsize + j - 3] + A01*(double)pTempData[(i - 3)*rwsize + j - 2] + A02*(double)pTempData[(i - 3)*rwsize + j - 1] + A03*(double)pTempData[(i - 3)*rwsize + j] + A04*(double)pTempData[(i - 3)*rwsize + j + 1] + A05*(double)pTempData[(i - 3)*rwsize + j + 2] + A06*(double)pTempData[(i - 3)*rwsize + j + 3]
+ A10*(double)pTempData[(i - 2)*rwsize + j - 3] + A11*(double)pTempData[(i - 2)*rwsize + j - 2] + A12*(double)pTempData[(i - 2)*rwsize + j - 1] + A13*(double)pTempData[(i - 2)*rwsize + j] + A14*(double)pTempData[(i - 2)*rwsize + j + 1] + A15*(double)pTempData[(i - 2)*rwsize + j + 2] + A16*(double)pTempData[(i - 2)*rwsize + j + 3]
+ A20*(double)pTempData[(i - 1)*rwsize + j - 3] + A21*(double)pTempData[(i - 1)*rwsize + j - 2] + A22*(double)pTempData[(i - 1)*rwsize + j - 1] + A23*(double)pTempData[(i - 1)*rwsize + j] + A24*(double)pTempData[(i - 1)*rwsize + j + 1] + A25*(double)pTempData[(i - 1)*rwsize + j + 2] + A26*(double)pTempData[(i - 1)*rwsize + j + 3]
+ A30*(double)pTempData[(i + 0)*rwsize + j - 3] + A31*(double)pTempData[(i + 0)*rwsize + j - 2] + A32*(double)pTempData[(i + 0)*rwsize + j - 1] + A33*(double)pTempData[(i + 0)*rwsize + j] + A34*(double)pTempData[(i + 0)*rwsize + j + 1] + A35*(double)pTempData[(i + 0)*rwsize + j + 2] + A36*(double)pTempData[(i + 0)*rwsize + j + 3]
+ A40*(double)pTempData[(i + 1)*rwsize + j - 3] + A41*(double)pTempData[(i + 1)*rwsize + j - 2] + A42*(double)pTempData[(i + 1)*rwsize + j - 1] + A43*(double)pTempData[(i + 1)*rwsize + j] + A44*(double)pTempData[(i + 1)*rwsize + j + 1] + A45*(double)pTempData[(i + 1)*rwsize + j + 2] + A46*(double)pTempData[(i + 1)*rwsize + j + 3]
+ A50*(double)pTempData[(i + 2)*rwsize + j - 3] + A51*(double)pTempData[(i + 2)*rwsize + j - 2] + A52*(double)pTempData[(i + 2)*rwsize + j - 1] + A53*(double)pTempData[(i + 2)*rwsize + j] + A54*(double)pTempData[(i + 2)*rwsize + j + 1] + A55*(double)pTempData[(i + 2)*rwsize + j + 2] + A56*(double)pTempData[(i + 2)*rwsize + j + 3]
+ A60*(double)pTempData[(i + 3)*rwsize + j - 3] + A61*(double)pTempData[(i + 3)*rwsize + j - 2] + A62*(double)pTempData[(i + 3)*rwsize + j - 1] + A63*(double)pTempData[(i + 3)*rwsize + j] + A64*(double)pTempData[(i + 3)*rwsize + j + 1] + A65*(double)pTempData[(i + 3)*rwsize + j + 2] + A66*(double)pTempData[(i + 3)*rwsize + j + 3];
我从http://dev.theomader.com/gaussian-kernel-calculator/获得了这些值
但处理的输出存在差异。
GIMP 到高斯模糊使用什么 sigma 值?