加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

Matlab help 图像去模糊

(2014-02-22 22:28:06)
标签:

deblurring

help

deconvwnr

去模糊

分类: Matlab
Deblurring

一、利用维纳滤波 (Winer Filter) 去模糊
主要通过函数 deconvwnr 实现,维纳滤波去模糊需要了解图像噪声的部分信息,否则很难得到满意的结果。

1. 显示原始图像
im2double(imread('cameraman.tif'));
imshow(I);
title( 'Original Image' );
http://s11/middle/002pSPISzy6GNjBGDcC8a&690help 图像去模糊" TITLE="Matlab help 图像去模糊" />

2. 仿真相机移动信号
LEN 21;
THETA 11;
PSF fspecial('motion'LEN, THETA);
blurred imfilter(I, PSF, 'conv''circular');
figure, imshow(blurred);
http://s15/middle/002pSPISzy6GNjBHzLUfe&690help 图像去模糊" TITLE="Matlab help 图像去模糊" />

3. 仿真噪声
noise_mean 0;
noise_var 0.0001;
blurred_noisy imnoise(blurred, 'gaussian'...
    noise_mean, noise_var);
figure, imshow(blurred_noisy);
title( 'Simulate Blur and Noise');
http://s16/middle/002pSPISzy6GNjBKbxR1f&690help 图像去模糊" TITLE="Matlab help 图像去模糊" />

4. 无噪声假设的条件下重构图像
estimated_nsr 0;
wnr2 deconvwnr(blurred_noisy, PSF, estimated_nsr);
figure, imshow(wnr2);
title( 'Restoration of Blurred, Noisy Image Using NSR 0');
http://s13/middle/002pSPISzy6GNjBN7Nqbc&690help 图像去模糊" TITLE="Matlab help 图像去模糊" />

5. 进行合理的噪声假设重构图像
estimated_nsr noise_var var(I(:));
wnr3 deconvwnr(blurred_noisy, PSF, estimated_nsr);
figure, imshow(wnr3)
title( 'Restoration of Blurred, Noisy Image Using Estimated NSR');
http://s2/middle/002pSPISzy6GNjBPitH11&690help 图像去模糊" TITLE="Matlab help 图像去模糊" />

二、使用 Regularized Filter 实现去模糊

read an image
imread('tissue.png');
I(125+[1:256],1:256,:);
figure, imshow(I)
title( 'Original Image' )
 
create the PSF
PSF fspecial('gaussian',11,5);
 
create simulated blur in the image and add noise
Blurred imfilter(I,PSF,'conv');
.02;
BlurredNoisy imnoise(Blurred,'gaussian',0,V);
figure, imshow(BlurredNoisy)
title( 'Blurred and Noisy Image')
 
use deconvreg to deblur the image.
NP prod(size(I));
[reg1 LAGRA] deconvreg(BlurredNoisy, PSF, NP);
figure, imshow(reg1);
title( 'Restored Image' );
http://s16/middle/002pSPISzy6GNjBSs6H8f&690help 图像去模糊" TITLE="Matlab help 图像去模糊" />
http://s15/middle/002pSPISzy6GNjBXhUi3e&690help 图像去模糊" TITLE="Matlab help 图像去模糊" />

三、使用 Lucy-Rocjardson 算法实现去模糊

imread('board.tif');
I(50+[1:256],2+[1:256],:);
subplot(131), imshow(I)
title( 'Original Image' )
 
PSF fspecial('gaussian',5,5);
 
Blurred imfilter(I,PSF,'symmetric','conv');
 
.002;
BlurredNoisy imnoise(Blurred,'gaussian',0,V);
subplot(132), imshow(BlurredNoisy)
title( 'Blurred and Noisy Image')
 
luc1 deconvlucy(BlurredNoisy, PSF, 5);
subplot(133), imshow(luc1);
title( 'Restored Image' );
http://s5/middle/002pSPISzy6GNjBZOVmf4&690help 图像去模糊" TITLE="Matlab help 图像去模糊" />

四、使用 Blind Deconvolution Algorithm 去模糊
这个方法过程相对复杂些,Matlab help 中有详细的例子介绍。






0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有