From: Steinar H. Gunderson Date: Sat, 13 Oct 2012 01:01:39 +0000 (+0200) Subject: Fix the mishandling of radius in the Gaussian deconvolution (it was off by a factor... X-Git-Tag: 1.0~285 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=9bfa15dcbddfdeaaba490879362f74d75982ee2f Fix the mishandling of radius in the Gaussian deconvolution (it was off by a factor of sqrt(2)). --- diff --git a/deconvolution_sharpen_effect.cpp b/deconvolution_sharpen_effect.cpp index ab28eb3..38cf0cf 100644 --- a/deconvolution_sharpen_effect.cpp +++ b/deconvolution_sharpen_effect.cpp @@ -268,8 +268,7 @@ void DeconvolutionSharpenEffect::update_deconvolution_kernel() if (gaussian_radius < 1e-3) { val = (x == 0 && y == 0) ? 1.0f : 0.0f; } else { - float z = hypot(x, y) / gaussian_radius; - val = exp(-z * z); + val = exp(-(x*x + y*y) / (2.0 * gaussian_radius * gaussian_radius)); } gaussian_h(y + 2 * R, x + 2 * R) = val; }