1 | initial version |
Your problem here is that you are calling the function with the wrong arguments. The signature for the undistortPoints function in the cv2 namespace is:
undistortPoints(src, cameraMatrix, distCoeffs[, dst[, R[, P]]]) -> dst
Note that the python function signature listed in the online documentation is for the old python interface living in namespace cv (not cv2). It turns out that a lot of the OpenCV functions don't document their method signature in the new cv2 python interface for whatever reason, but they often exist. IPython can help here for determining the correct method signature.
Also note another gotcha with this particular method. It expects the input points to be in a 3 dimensional array, so for example to transform two points you would need something like this:
pts = np.array([[[1.0, 1.0], [1.0, 2.0]]])