⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 noise_filtering_matlab.m

📁 digital image interpolation techniques including nearest neighbor, bilinear, bicubic and splin
💻 M
字号:
%PREPARE:
A=imread('plane.jpg');
imshow(A),title('Original Image')
[n m]=size(A); %get the size information

%add Gaussian Noise:
Gaus=imnoise(A,'gaussian');
figure,imshow(Gaus),title('Image with Gaussian Noise')
%using Harmonic mean filter for gaussian noise:
H=fspecial('average',[5 5]);
G=imfilter(Gaus,H);
figure,imshow(G),title('Image after Gaussian Noise Removal')

%add Uniform noise:
U=20*randn([n m]); %create a noise with a mean of 0 and a standard deviation of 20
figure,imshow(U,[]),title('Uniform Noise')
Uniform=uint8(uint8(U)+A);
figure,imshow(Uniform),title('Original Image with Added Uniform Noise')
%Remove Uniform Noise:
Un=imfilter(Uniform,H);
figure,imshow(Un),title('Image after Uniform Noise Removal')

%add salt and pepper noise:
SP=imnoise(A,'salt & pepper');
figure,imshow(SP),title('Image with Salt and Pepper Noise')
%using a Median filter for removing salt and pepper noise:
sp=medfilt2(SP);%median filtering
figure,imshow(sp),title('Image After Median Filtering')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -