【发布时间】:2022-01-20 05:16:45
【问题描述】:
大家早上好!
我在使用 opencv 函数 calibrateCamera 时遇到了以下错误:
OpenCV(4.5.4) D:\a\opencv-python\opencv-python\opencv\modules\calib3d\src\calibration.cpp:3350: error: (-210:Unsupported format or combination of formats) objectPoints should contain vector函数'cv::collectCalibrationData'中Point3f类型点的向量我试图找到解决方案,但除了类型问题或长度问题外,在任何地方都找不到任何东西。 我对 objPoints 和 imgPoints 都使用了 float 32 类型的 np.array:
objpoints = np.array(objpoints,dtype = np.float32) imgpoints = np.array(imgpoints,dtype = np.float32) ret,mtx,dist,rvecs,tvecs = cv2.calibrateCamera(objpoints,imgpoints,imsize,无,无)变量资源管理器为使用的变量提供以下值:
在:对象点 出去: 数组([[ 0. , 246.5, 0. ], [ 14.5, 246.5, 0. ], [ 43.5, 246.5, 0. ], ..., [174. , 0. , 0. ], [319. , 0. , 0. ], [333.5, 0. , 0. ]], dtype=float32) 在:imgpoints 出去: 数组([[1310., 1032.], [1258., 1032.], [1154., 1032.], [1206., 1032.], ..., [739., 134.], [686., 133.], [162., 132.], [110., 132.]], dtype=float32) 在: 尺寸 输出:(1080、1440) 在:len(imgpoints) 输出:440 在:len(objpoints) 输出:440我还尝试在 calibrateCamera 函数中切换 objpoints 和 imgpoints,但这会导致相同的错误消息。当我阅读了很多 C++ 中这个函数的解决方案时,我想指出这是一个与 Python 相关的问题。
我希望有人可以帮助我!提前致谢!
【问题讨论】:
标签: python numpy opencv camera-calibration aruco