def get_histogram(image, histogram_scale): h = cv2.calcHist([image], [0], None, [histogram_scale], [0, 256]).flatten() return h/256