首页 > 解决方案 > (-215:断言失败)与 initUndistortRectifyMap

问题描述

我正在(-215:Assertion failed)使用initUndistortRectifyMapPython 3 函数。请让我知道为什么我收到此错误,如下所示:

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'

我查看了以下帖子,但仍然无法解决此问题。

https://answers.opencv.org/question/68575/initundistortrectifymap-assert-error/

下面是我的源代码,其中cam_m我的图像中有两个特定点:

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);

标签: pythonopencv

解决方案


推荐阅读