问题
I am getting (-215:Assertion failed)
while using initUndistortRectifyMap
Python 3 function. Please let me know why I am getting this error as below:
map1,map2 = cv2.initUndistortRectifyMap(cam_m, dist_c, None, None, (2316,3088), cv2.CV_32FC1)
cv2.error: OpenCV(4.1.0) /tmp/opencv-20190505-12101-14vk1fh/opencv-4.1.0/modules/calib3d/src/undistort.cpp:232: error: (-215:Assertion failed) A.size() == Size(3,3) && A.size() == R.size() in function 'initUndistortRectifyMap'
I have looked at below posts but I am still unable to resolve this issue.
https://answers.opencv.org/question/68575/initundistortrectifymap-assert-error/
Below is my source code where the cam_m
has two specific points in my image:
cam_m=np.array([[293.278, -817.067, 918.225],[507.324, -573.223, 831.045]])
dist_c=np.array([3.3037193933075820e-01, -2.0144603430574297e+00, 0, 0, 3.6424949872867396e+00])
map1,map2 = cv2.initUndistortRectifyMap(cam_m, dist_c, None, None, (2316,3088), cv2.CV_32FC1)
imageRectified = cv2.remap(image, imageRectified,map1, map2, INTER_LINEAR, BORDER_CONSTANT, 0);
来源:https://stackoverflow.com/questions/56536111/215assertion-failed-with-initundistortrectifymap