matlab图像加噪

clear
clc
close all

RGB=imread('hjq.jpeg');
I=rgb2gray(RGB);
I2G=imnoise(I,'gaussian',0.02);
I2=imnoise(I,'salt & pepper',0.02);
I2O=imnoise(I,'salt & pepper',0.2);
figure(1),imshow(RGB);
figure(2),imshow(I);
figure(3),imshow(I2G);
figure(4),imshow(I2O);


你可能感兴趣的:(matlab图像加噪)