equired argument 'ranges' (pos 2) not found in cv2.warpAffine

I'm trying to use the transformation function cv2.warpAffine and pretty much copying how it was done in the documentation (https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html?highlight=warpaffine)

Documentation:

M = np.float32([[1,0,100],[0,1,50]])
dst = cv2.warpAffine(img,M,(cols,rows))

Mine:

M=np.float32([[1, 0, shiftx], [0, 1, shifty]])
dst=cv2.warpAffine(cv2.UMat(img), M, (cols, rows))

However when I try to run this I receive the error "TypeError: Required argument 'ranges' (pos 2) not found". I don't understand what this is referring to and how to correct it.

#python #opencv

3 Likes41.15 GEEK