维纳滤波图像去噪源码程序,程序员在编程的过程中可以参考学习使用,希望对IT程序员有用,此源码程序简单易懂、方便阅读,有很好的学习价值!
clc;
clear;
close all;
I=imread('cameraman.bmp');
figure(1);imshow(I,[]);
PSF=fspecial('motion',40,75);
MF=imfilter(I,PSF,'circular');
noise=imnoise(zeros(size(I)),'gaussian',0,0.01);
MFN=imadd(MF,im2uint8(noise));
figure(2);imshow(MFN,[]);
NSR=sum(noise(:).^2)/sum(MFN(:).^2);
figure(3);
imshow(deconvwnr(MFN,PSF),[]);
figure(4);
imshow(deconvwnr(MFN,PSF,NSR),[]);
NP=0.02*prod(size(I));
[reg1 LAGRA]=deconvreg(MFN,PSF,NP/3.0);
figure(5);imshow(reg1);
edged=edgetaper(MFN,PSF);
reg2=deconvreg(edged,PSF,[],LAGRA/300);
figure(6);imshow(reg2);