参考
OpenCV: Histograms - 1 : Find, Plot, Analyze !!!
前提
pythonによる画像処理 - あたりめ備忘録
plt.hist(img.ravel(),256,[0,256]) plt.show()
>>
from scipy import misc color = ("B", "G", "R") for channel, col in enumerate(color): histr = cv2.calcHist([img], [channel], None, [256], [0, 256]) plt.plot(histr, color=col) plt.xlim([0, 256]) plt.show()
>>