cv2.calcBackProject对于3D直方图失败

时间:2014-09-30 19:30:24

标签: python opencv

当应用于3D直方图到cv2.calcBackProject时,输出只是一个空白(即它没有失败但返回没有投影的空白屏幕)。有没有人知道为什么以及如何在OpenCV python上应用3D直方图反投影?

....

dims = 3 # cv2.calcBackProject works if dims is set to a value less than 3 (i.e. not return blank)
channels = list(xrange(dims))
size = [4] * dims
ranges = [0, 255] * dims

hist = cv2.calcHist([roi], channels=channels, mask=None, histSize=size, ranges=ranges)
projection = cv2.calcBackProject([image], channels=channels, hist=hist, ranges=ranges, scale=1)

...

谢谢!

0 个答案:

没有答案