X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=deconvolution_sharpen_effect.cpp;h=a90e5cc6f8c1e3463c458e87eb4f451dfdb43a3e;hp=ab28eb387d980ec8923ec150b1f3903e04e85f10;hb=c208d2719d48f7676d73b6f406f2417ec147acae;hpb=71a27346652e54781215737255f757f6292ff120 diff --git a/deconvolution_sharpen_effect.cpp b/deconvolution_sharpen_effect.cpp index ab28eb3..a90e5cc 100644 --- a/deconvolution_sharpen_effect.cpp +++ b/deconvolution_sharpen_effect.cpp @@ -2,15 +2,19 @@ // Since all of our signals are symmetrical, discrete correlation and convolution // is the same operation, and so we won't make a difference in notation. - -#include -#include #include #include +#include +#include +#include +#include +#include +#include +#include #include "deconvolution_sharpen_effect.h" +#include "effect_util.h" #include "util.h" -#include "opengl.h" using namespace Eigen; @@ -236,16 +240,6 @@ MatrixXf central_convolve(const MatrixXf &a, const MatrixXf &b) return result; } -void print_matrix(const MatrixXf &m) -{ - for (int y = 0; y < m.rows(); ++y) { - for (int x = 0; x < m.cols(); ++x) { - printf("%7.4f ", m(x, y)); - } - printf("\n"); - } -} - } // namespace void DeconvolutionSharpenEffect::update_deconvolution_kernel() @@ -268,8 +262,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; }