Cv2.calcBackProject does not work for 3D histograms

When applied to 3D histograms to cv2.calcBackProject, the output is just blank (that is, it does not fail, but returns a blank screen with no projection). Does anyone know why and how to apply 3D back projection histograms in Python OpenCV?

....

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)

...

      

Thank!

+3


source to share





All Articles