这是图像去模糊的第三篇,接着上节说道逆滤波对噪声特别敏感。约束最小二乘方滤波(Constrained Least Squares Filtering,aka Tikhonov filtration,Tikhonov regularization)核心是H对噪声的敏感性问题。减少噪声敏感新问题的一种方法是以平滑度量的最佳复原为基础的,因此我们可以建立下列约束条件:
如何求解这个式子呢,将上式表示成矩阵形式,同时将约束项转换成拉格朗日乘子项,可得到
close all;
clear all;
clc;
% Display the original image.
I = im2double(imread('lena.jpg'));
[hei,wid,~] = size(I);
subplot(2,3,1),imshow(I);
title('Original Image (courtesy of MIT)');
% Simulate a motion blur.
LEN = 21;
THETA = 11;
PSF = fspecial('motion', LEN, THETA);
blurred = imfilter(I, PSF, 'conv', 'circular');
subplot(2,3,2), imshow(blurred); title('Blurred Image');
% Inverse filter
If = fft2(blurred);
Pf = psf2otf(PSF,[hei,wid]);
deblurred = ifft2(If./Pf);
subplot(2,3,3), imshow(deblurred); title('Restore Image')
% Simulate additive noise.
noise_mean = 0;
noise_var = 0.00001;
blurred_noisy = imnoise(blurred, 'gaussian', ...
noise_mean, noise_var);
subplot(2,3,4), imshow(blurred_noisy)
title('Simulate Blur and Noise')
% Try restoration using Home Made Constrained Least Squares Filtering.
p = [0 -1 0;-1 4 -1;0 -1 0];
P = psf2otf(p,[hei,wid]);
gama = 0.001;
If = fft2(blurred_noisy);
numerator = conj(Pf);
denominator = Pf.^2 + gama*(P.^2);
deblurred2 = ifft2( numerator.*If./ denominator );
subplot(2,3,5), imshow(deblurred2)
title('Restoration of Blurred Using Constrained Least Squares Filtering');
subplot(2,3,6); imshow(deconvreg(blurred_noisy, PSF,0)); title('Regul in Matlab');
依次是原图,运动模糊图像,逆滤波结果,运动模糊+高斯噪声,Home Made 约束最小二乘方滤波( γ=0.001,交互设置 ),Matlab自带的去模糊deconvreg函数。
定义一个“残差”向量 R 为
RESTORATION OF DEFOCUSED AND BLURRED IMAGES http://yuzhikov.com/articles/BlurredImagesRestoration1.htm
图像去模糊 (维纳滤波)http://blog.csdn.net/bluecol/article/details/46242355
图像去模糊(逆滤波)http://blog.csdn.net/bluecol/article/details/47357717
数字图像处理(第三版) 冈萨雷斯著 chapter 5,图像复原与重建
MathLab source code, deconvreg.m
作者 | 日期 | 联系方式 |
---|---|---|
风吹夏天 | 2015年8月8日 | [email protected] |