图像复原技术
一、常见噪声
1.高斯噪声(gaussian)、椒盐噪声(salt&pepper)、均匀分布噪声、指数分布噪声、伽马分布噪声
2.添加噪声:imnoise(I,type,parameters);
高斯噪声
close all;clear all;clc;
I=uint8(100*ones(256,256));
J=imnoise(I,'gaussian',0,0.01);%高斯噪声,均值为0,方差为0.01
K=imnoise(I,'gaussian',0,0.03);
figure;
subplot(121);imshow(J);
subplot(122);imhist(J);%显示直方图信息
figure;
subplot(121);imshow(K);
subplot(122);imhist(K);
椒盐噪声
close all;clear all;clc;
I=imread('E:\Matlab_exercise\图片素材\grayBeauty.jpg');
I=im2double(I);
J=imnoise(I,'salt & pepper',0.01);%椒盐噪声,密度为0.01
K=imnoise(I,'salt & pepper',0.03);
L=medfilt2(K);%中值滤波,很好的去除椒盐噪声
figure;
subplot(131);imshow(J);
subplot(132);imshow(K);
subplot(133);imshow(L);
泊松噪声
close all;clear all;clc;
I=imread('E:\Matlab_exercise\图片素材\meigui.jpg');
J=imnoise(I,'poisson');
figure;
subplot(121);imshow(I);
subplot(122);imshow(J);
乘性噪声
close all;clear all;clc;
I=imread('E:\Matlab_exercise\图片素材\gray.jpg');
J=imnoise(I,'speckle');%乘性噪声方差默认值为0.04
K=imnoise(I,'speckle',0.2);
figure;
subplot(121);imshow(J);
subplot(122);imshow(K);
均匀分布噪声
close all;clear all;clc;
m=256;n=256;
a=50;b=180;%50-180噪声均匀分布
I=a+(b-a)*rand(