def accumulated_histogram(images, args):
histogram = args[0]
try:
image, x, y = images.get(timeout=0.3)
except:
return
hsv = cv2.cvtColor(np.array(image, dtype=np.uint8), cv2.COLOR_RGB2HSV)
current_histogram = histogram.get()
new_histogram = list(map(lambda x: cv2.calcHist([hsv[:,:,x]],
[0],
None,
[256],
[0, 256],
hist=current_histogram[x],
accumulate=True),
range(3)))
histogram.put(new_histogram)
images.task_done()
评论列表
文章目录