calculate blur kernel from original and blurry images

Version 1.0 (1010 KB) by Dan
deconvolution, deblur, fast, ransac, blur kernel
1.4K Downloads
Updated 16 Jan 2016

View License

If you are in the situation in which you have the original image ( or an image which is very close to the original - for example in successive frames of a video) than you can use this function to get a good estimate of the blur kernel much faster than working with the blurry image only.
there is a simple demo that should work out of the box .
let me know if there is any problems with this :)
%purpose:
% estimate quickly and effectively the kernel that was used to blur img_orig
% into img_blurred.
% method:
% This function treats the kernel as the solution to an over-constrained
% problem. In other words :
% 1) blurred image = original image ** blur kernel ; where ** = convolution
% 2) hence for each pixel:
% blurred image(i,j) = original image( neighborhood(i,j) .* blur kernel)
% 3) a set of equations (2) can be set for different i,j's to solve for
% the blur kernel.
% 4) there are many many more equations than needed to solve for the blur
% kernel
% A variation of the ransac algorithm is implemented in order to
% find a good estimate of the blur kernel.
kind regards,
dan

Cite As

Dan (2024). calculate blur kernel from original and blurry images (https://www.mathworks.com/matlabcentral/fileexchange/54944-calculate-blur-kernel-from-original-and-blurry-images), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0

small big fix
image