def histogram(self, image, mask=None):
#Extract a 3D color histogram from the masked region of the image, using
#the supplied number of bins per channel, then normalize the histogram
new_im = imcrop(image)
hist = cv2.calcHist([new_im], [0, 1, 2], mask, self.bins,[0, 256, 0, 256, 0, 256])
hist = cv2.normalize(hist).flatten()
return hist
评论列表
文章目录