绘制直方图
from skimage import exposure
# 绘制彩色图像的c通道的直方图
img_hist, bins = exposure.histogram(img[..., c], source_range='dtype')
# 以第c行第i列的形式绘制归一化直方图
axes[c, i].plot(bins, img_hist / img_hist.max())
绘制累积直方图
from skimage import exposure
img_cdf, bins = exposure.cumulative_distribution(img[..., c])
axes[c, i].plot(bins, img_cdf)
直方图匹配(histogram matching)
含义:使源图像的累积直方图和目标图像一致
from skimage.exposure import match_histograms
# 参数1:源图像;参数2:目标图像;参数3:多通道匹配
matched = match_histograms(image, reference, multichannel=True)
实验:直方图匹配效果
"""
==================
Histogram matching
==============&