Or pushed it through the book,
It's good to understand after writing it all over again.
Maybe it's just that this algorithm is a relatively simple foundation ...
To tell the end is the knowledge of statistics, two-dimensional least squares,
Minimize mean variance
Release code:
I=imread (' src.png '); I0=rgb2gray (I); subplot (151); Imshow (I0); title (' Src '); H=fspecial (' Motion ', 30,45); % motion convolution of the offset matrix Motionblur=imfilter (i0,h,0, ' conv '); % convolution mf=imfilter (i0,h, ' circular ', ' conv ');% image size expands subplot by seeing the image as a period of a two-dimensional periodic function; Imshow (Motionblur); Title (' Motionblur ') subplot (153); imshow (MF); title (' MF ') WNR=DECONVWNR (motionblur,h); subplot (154); Imshow (WNR) title (' Motionblur recovery ') WNR1=DECONVWNR (mf,h); subplot (155); Imshow (WNR1) title (' MF recovery ')
There is a problem is imfilter matrix, the inside of the circular is based on the period to complement the matrix, the recovery effect is better.
The direct complement of 0, is motionblur this effect.
Refer to the MATLAB image Processing Super Learning Handbook
Restoration of degraded image based on MATLAB (III.)------Wiener Filter Restoration