Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

getRotationMatrix2D gives error

The python function getRotationMatrix2D as follows

center = tuple(np.array(image.shape)/2)
rot_mat = cv2.getRotationMatrix2D(center,angle,1.0)
result = cv2.warpAffine(image, rot_mat, image.shape,flags=cv2.INTER_LINEAR)

gives this error

Traceback (most recent call last):
File "C:\Users\zeeshan khan\Desktop\opencv\Code\Python\rotate.py", line 13, in <module>
rot_mat = cv2.getRotationMatrix2D(center,angle,1.0)
TypeError: function takes exactly 2 arguments (3 given)