from matplotlib import pyplot as plt
import cv2
girl = cv2.imread("test.jpg")
cv2.imshow("girl",girl)
color = ("b","g","r")
for i,color in enumerate(color):
hist = cv2.calcHist([girl],[i],None,[256],[0,256])
plt.title("girl")
plt.xlabel("Bins")
plt.ylabel("num of perlex")
plt.plot(hist,color=color)
plt.xlim([0,256])
plt.show()
cv2.waitKey()
cv2.destoryAllWindows()