Ask Your Question

Revision history [back]

OpenCV Python: can not pass UMat to calcHist

Hello, everyone!

I'm trying to pass cv2.UMat object to cv2.calcHist function:

a = np.arange(10, dtype=np.uint8)
b = cv2.UMat(a)
cv2.calcHist([b], [0], None, [10], [0, 10])

and I'm getting the error

TypeError: images is not a numpy array, neither a scalar

but it seems like cpp version of OpenCV allows using UMat as source image.

Is it me doing something wrong or python OpenCV doesn't allow using UMat as source image for calcHist?