中文说明:可以处理彩色图像,也可以直接处理灰度图。 彩色图像,会先转成灰度图。 转成灰度图后,对整个灰度图像的像素值进行概率统计, 统计出不同灰度值的分布和频率,利用直方图的形式显示出来,然后对直方图进行平均化处理,使图像的像素分布更均匀,达到增强对比的目的。源码中包含彩色和灰度图两种处理方式的代码,去掉注释即可。附带一张图可以进行实验。
English Description:
Can handle color images, you can also deal directly with grayscale. Color images will be converted to grayscale. After the conversion to grayscale, the entire grayscale image pixel values for probability and statistics, statistics of frequency and distribution different gray values, histogram is displayed, and then averaging the histogram processing, ensures more uniform distribution of the pixels of an image, and achieve the purpose of enhancing contrast.Your source code contains the color and grayscale image handling code, remove the comment.Comes with a diagram to experiment.