python - (-215:断言失败)与 initUndistortRectifyMap
问题描述
我正在(-215:Assertion failed)
使用initUndistortRectifyMap
Python 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);
解决方案
推荐阅读
- python-3.x - 比较不同顺序的字典列表和多个键
- amazon-web-services - AWS MWAA/Apache 气流:如何调试 on_failure_callback 本身
- python - 如何将输入框(tkinter)中的文本分配给python脚本中的变量并通过按下按钮运行脚本?
- excel - 循环遍历行,存储列,作为行粘贴到新工作表
- javascript - Javascript 语音合成
- reactjs - 如何将this.state放入状态改变后不会改变的变量?
- c - 如何从十六进制转换为 Unicode 代码点?
- r - 如何在不使用 R 中的 BiodiversityR 包的情况下使用 Bray-Curtis 指数在 PCA 中添加影响因素?
- ruby-on-rails - 如果下一个操作是在您希望用户去的地方以外的任何地方,那么运行某些条件的最佳方法是什么?
- javascript - Ajax 在 Chrome 或 IE 中不起作用,但在 FireFox 中起作用