cv2.calcHist()函数返回值,灰度值为255的像素个数看似为0的细节探究。 import cv2 import matplotlib.pyplot as plt import numpy as np img=cv2.imread("gray.jpg",cv2.IMREAD_GRAYSCALE) #灰度模式加载。 print(img.shape) H=np.zeros(256) for i in range(img.shape[0]): for j in range(img.shape[