clc;
clear all;
close all;
I =imread('D:/matlab_project/city_afternoon.png');%读取图像原图
img =rgb2gray(I);%rgb2gray函数的作用就是将彩色图像转换为灰度图像
imgs=im2double(img);
figure;
subplot(2,2,1);
imshow(img);title('原始图像');
subplot(2,2,2);
imshow(histeq(imgs));title('直方图均衡算法处理结果');
subplot(2,2,3);
imhist(img);title('原图直方图统计');
subplot(2,2,4);
imhist(imgs);title('直方图均衡直方图统计');