1

I have two images: original and blured. The main problem is to estimate kernel which was used for convolution of original image for getting blured.

Simple example getting blured image:

    Mat src_raw = imread("D:/codes/debluring/img/lena.png", 1);

    Mat kernel = (Mat_<float>(5, 5) <<
        0.0392, 0.0398, 0.0400, 0.0398, 0.0392,
        0.0398, 0.0404, 0.0406, 0.0404, 0.0398,
        0.0400, 0.0406, 0.0408, 0.0406, 0.0400,
        0.0398, 0.0404, 0.0406, 0.0404, 0.0398,
        0.0392, 0.0398, 0.0400, 0.0398, 0.0392
        );

    Mat blured;
    filter2D(src_raw, blured, src_raw.depth(), kernel);

    imshow("Source Image", src_raw);
    imshow("Blurred", blured);
    cvWaitKey(0);

Now imagine that i have Mat src_raw and blured and should estimate kernel. I didn't find any opencv functions to do it. Maybe i'll need some optimization algorithm to get it? If yes, can I find it in opencv package?

Thank you

enter image description here

Community
  • 1
  • 1
dandycomp
  • 43
  • 5

1 Answers1

1

If I understand correctly, you want to solve a deconvolution problem, here are two related papers with source code provided:

Vincent Vidal
  • 323
  • 2
  • 11