clear all;
clear clc;
I=imread('捕获2.png');
I1=rgb2gray(I);
figure
subplot(2,2,1)
imshow(I1);
[w,h,z]=size(I1);
[x,y]=meshgrid(1:h,1:w)
subplot(2,2,2)
mesh(x,y,I1)
colormap jet ;
I2=imnoise(I1,'gaussian',0,0.001);%%%%%%%%%%%%%%%%%%%加入高斯噪声函数,mean=0,standard dev=0.001
subplot(2,2,3)
imshow(I2);
subplot(2,2,4)
mesh(x,y,I2)
colormap jet ;
T=zeros(w,h)
I3=imnoise(I1,'salt & pepper',0.0005);%%%%%%%%%%%%%%%%%%%加入椒盐噪声函数,standard dev=0.0005
sigma=1;
Ig=fspecial('gaussian',[5,5],sigma) ;
img_gauss=imfilter(I2,Ig,'replicate');%%%%%%%%%%%%%%%%%%%%%%matlab自带库高斯滤波函数,滤除噪声
figure
subplot(2,2,1)
imshow(I2)
subplot(2,2,2)
imshow(I3)
subplot(2,2,3)
imshow(img_gauss)
K = medfilt2(I2,[3,3]);
[X,Y]=size(K)
[M,N]=meshgrid(1:Y,1:X)
subplot(2,2,4);
mesh(M,N,K)
colormap jet;
figure
subplot(2,2,1)
imshow(K)
subplot(2,2,2)
mesh(x,y,I3)
colormap jet ;
K = medfilt2(I3,[3,3]);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%matlab自带中值滤波函数滤除椒盐噪声,窗口大小为【3*3】
[X,Y]=size(K)
[M,N]=meshgrid(1:Y,1:X)
subplot(2,2,3);
mesh(M,N,K)
colormap jet;

%[]meshgrid

(matlab)自带库函数加入高斯噪声和椒盐噪声,并使用自带库滤除噪声(3d显示)

(matlab)自带库函数加入高斯噪声和椒盐噪声,并使用自带库滤除噪声(3d显示)

(matlab)自带库函数加入高斯噪声和椒盐噪声,并使用自带库滤除噪声(3d显示)


相关文章:

  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
  • 2021-08-31
  • 2021-04-28
猜你喜欢
  • 2021-05-21
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
相关资源
相似解决方案