gpt4 book ai didi

python - 相机标定opencv python

转载 作者:太空宇宙 更新时间:2023-11-03 22:50:23 27 4
gpt4 key购买 nike

我正在学习 OpenCV 教程 http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_calib3d/py_calibration/py_calibration.html

我没有使用棋盘运行它,而是从 LAS 文件中获取了 3D 点坐标。这是我的代码:

import cv2
import numpy as np

obj_point = [(630931.35,4833642.85,157.67),(630948.03,4833662.76,73.94), (631156.3, 4833904.18, 43.89),(630873.71, 4833790, 44.85), (631381.3, 4834152.6, 79.41)]
img_point = [(1346.82,843.206),(1293.03,808.146),(1041.92, 585.168), (1150.21, 894.724), (756.993,345.904) ]

obj_point = np.array(obj_point,'float32')
img_point = np.array(img_point,'float32')

ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(obj_point, img_point, (1125, 1725),None,None)

我收到以下错误信息:

For non-planar calibration rigs the initial intrinsic matrix must be specified in function cvCalibrateCamera2

提前致谢!

最佳答案

您需要使用标志 CV_CALIB_USE_INTRINSIC_GUESS

关于python - 相机标定opencv python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39085875/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com