python学习笔记12 plt.hist

版权声明: https://blog.csdn.net/qq_40025335/article/details/81607667
# from PIL import Image
import  cv2
import numpy as np
from matplotlib import pyplot as plt

src = cv2.imread('C:\\Software\\Python\\left_3.jpg')
img=np.array(src)
plt.figure("zhifangtu")
arr=img.flatten()
n, bins, patches = plt.hist(arr, bins=256, normed=1, facecolor='green', alpha=0.75)
plt.show()

-------------------------------------

猜你喜欢

转载自blog.csdn.net/qq_40025335/article/details/81607667
plt