Unlike the standard (and more challenging) de-blurring and super resolution scenarios, I have access to both the original (sharp) image G and it's blurred version B. I'm simply looking for the blur kernel h. So because B is taken using a real camera the relation is:
B=G*h+N (where * denotes convolution and N is some additive noise)
Naturally, this is an over-constrained problem since h is small in size compared to G and B and so every few pixels in the pair of images generate an equation on the entries of h.
But what would be the simplest way to actually implement this? My thoughts so far:
- Moving to the frequency domain and doing division (as this answer suggests). But this would be inevitably numerically unstable because of the noise right?
- Cross-correlation - I've only found examples for 1-D signals and couldn't figure out how to use in the 2D case of images.
- Carefully constructing an over-constrained linear system
G'h'=B'looking forh'which is a vector version of the entries of the kernelhusing some optimization procedure. But this is very tedious and the matrixG'and vectorB'are bound to be huge in size.
A concrete example in any programming language from C++ to MATLAB would be extremely useful.