%原图像显示
picture_read = imread(‘1.jpg‘);
subplot(2,4,1);
figure0 = imshow(picture_read);
title(‘原图‘)
%图像灰度化
picture_gray = rgb2gray(picture_read);
subplot(2,4,2);
figure1=imshow(picture_gray);
title(‘图像灰度化‘)
%直方图均衡
picture_balance = histeq(picture_gray);
subplot(2,4,3);
figure2 = imshow(picture_balance);
title(‘直方图均衡‘)
%图像加上高斯噪声
picture_gaussian = imnoise(picture_gray,‘gaussian‘);
subplot(2,4,4);
figure3 = imshow(picture_gaussian);
title(‘加上高斯噪声‘)
%图像加上椒盐噪声
picture_salt = imnoise(picture_gray,‘salt & pepper‘);
subplot(2,4,5);
figure4 = imshow(picture_salt);
title(‘加上椒盐噪声‘)
%图像加上泊松噪声
picture_poisson = imnoise(picture_gray,‘poisson‘);
subplot(2,4,6);
figure5 = imshow(picture_poisson);
title(‘加上泊松噪声‘);
%绘制灰度直方图
figure, imhist(picture_gray);
原文地址:https://www.cnblogs.com/rolingball-creation/p/10575597.html