Found solution https://github.com/opencv/opencv/issues/4943
OpenCV Error:
The statement failed (CV_IS_MAT (_src) && CV_IS_MAT (_dst) && (_src-> rows == 1 || _src-> cols == 1) && & (_dst-> rows == 1 || _dst-> cols == 1) && & & _src-> cols + _src-> rows - 1 == _dst-> rows + _dst-> cols - 1 && & & (CV_MAT_TYPE (_src-> type) == CV_32FC2 || CV_MAT_TYPE (_src-> type) == CV_64FC2) && (CV_MAT_TYPE (_dst-> type) == CV_32FC2 || CV_MAT_TYPE (_dst-> type) == CV_64FC2)) in cvUndistortPoints, file / home / javvaji / opencv -3.2.0 / modules / imgproc /src/undistort.cpp, line 293
retval, rvec, tvec = cv2.solvePnP(cam.object_points, cam.image_points, cam.camera_matrix, cam.dist_coefficients, None, None, False, cv2.SOLVEPNP_P3P)
I am using the solvePnP function with the SOLVEPNP_P3P flag. It gives an assertion error. The same solvePnP code works fine with the SOLVEPNP_ITERATIVE flag. With the P3P flag, it internally calls the undistortPoints function, which gives an error.
solvePnP code ref: https://github.com/opencv/opencv/blob ...
How to resolve this?
source
share