python - CV.CalibrateCamera2 (python) "Both matrices must have the same number of points"

标签 python linux opencv

我希望这是一个相当简单的问题;我正在尝试使用以下 openCV 命令;

cv.CalibrateCamera2(object_points2, image_points2, point_counts2, cv.GetSize(image), intrinsic_matrix, distortion_coeffs, rvecs, tvecs, 0)

但是我收到以下错误;

cv.error: Both matrices must have the same number of points

使用 numpy.shape 和 numpy.array,数组的形状为;

print shape(array(object_points2)) --> (980, 3)
print shape(array(image_points2)) --> (980, 2)
print shape(array(point_counts2)) --> (20, 1)
print shape(array(intrinsic_matrix)) --> (3, 3)
print shape(array(distortion_coeffs)) --> (5, 1)
print shape(array(rvecs)) --> (20, 3)
print shape(array(tvecs)) --> (20, 3)

我显然错过了一些东西,但一整天都在试图解决这个问题! 我是不是傻了?

提前非常感谢! :) 乔什

最佳答案

您可能已经解决了这个问题,但供将来引用: 当point_counts2中的数据没有面对object_points2的长度时,我遇到了这样的错误。

关于python - CV.CalibrateCamera2 (python) "Both matrices must have the same number of points",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7706577/

相关文章:

python-2.7 - Opencv:检测点击图片的鼠标位置

c++ - 将图像输出回 matlab Mex

python - sqlalchemy 表达式 not_

javascript - 未调用 AJAX 成功回调函数

python - 按组扩展具有缺失日期的数据框并进行插值

linux - ARM armv5tejl 交叉编译

c++ - 交叉编译: check if it is possible to build 32 bit on a 64 bit machine

c - 如何防止客户端可以在服务器的任何目录中搜索文件?

python - 使用套接字 API 编写基本的 HTTP 服务器

python - OpenCV CalcCovarMatrix 与 Numpy Cov