求一个matlab直方图均衡化程序

如题所述

第1个回答  2019-12-13
你先把要处理的图像载入到matlab的work文件夹里面
a=imread(‘1.bmp’);
%输入真彩色图像
b=rgb2gray(a);
%转化成灰度图像
图像显示
figure(1)
subplot(1,2,1);imshow(a);
subplot(1,2,2);imshow(b);
%显示灰度图像与直方图
figure(2)
subplot(1,2,1);imshow(b);
subplot(1,2,2);imhist(b);
%直方图均衡化
c=histeq(b);
figure(3);
subplot(1,2,1);imshow(c);
subplot(1,2,2);imhist(c);
希望能对你有帮助~