calibrateCamera 和 projectPoints 的重新投影
Reprojection of calibrateCamera and projectPoints
我正在使用 OpenCV 的 calibrateCamera
并试图了解它如何计算重投影误差以及该误差代表什么。它似乎是投影点和测量图像点之间的(欧几里得)距离的 RMS——对吗?然而,最终的重投影误差为 "minimized" 意味着什么? calibrateCamera()
是否明确使用函数 projectPoints()
来查找投影点?
重投影误差是用估计的内在和外在矩阵重投影的3D点与通过某些图像处理技术检测到的2D图像点(例如棋盘图案的角)之间的误差(例如欧氏距离)。
最终的重投影误差被最小化,因为估计内在和外在参数集的问题是一个非线性问题,因此您必须迭代地找到使这个重投影误差最小化的参数集。
更多信息:A Flexible New Technique for Camera Calibration ; Zhengyou Zhang ; 2000.
我指的是 OpenCV 版本 3.1.0,在这里你可以找到 calibrateCamera
的文档
http://docs.opencv.org/3.1.0/d9/d0c/group__calib3d.html#ga687a1ab946686f0d85ae0363b5af1d7b 并且文档说(粗体是我的):
The algorithm performs the following steps:
Compute the initial intrinsic parameters (the option only available
for planar calibration patterns) or read them from the input
parameters. The distortion coefficients are all set to zeros initially
unless some of CV_CALIB_FIX_K? are specified.
Estimate the initial
camera pose as if the intrinsic parameters have been already known.
This is done using solvePnP .
Run the global Levenberg-Marquardt
optimization algorithm to minimize the reprojection error, that is,
the total sum of squared distances between the observed feature points
imagePoints and the projected (using the current estimates for camera
parameters and the poses) object points objectPoints. See
projectPoints for details.
The function returns the final re-projection error.
无论如何,与其依赖文档,我更愿意看一下代码:
https://github.com/Itseez/opencv/blob/3.1.0/modules/calib3d/src/calibration.cpp#L3298
当您使用projectPoints
时,您需要在重投影后手动计算RMS。这可能会有所帮助。
OPENCV: Calibratecamera 2 reprojection error and custom computed one not agree
这是 OpenCV 代码 calibrate.cpp 第 1629 行的重投影误差计算:
return std::sqrt(reprojErr/total);
其中 total 是所有图像的所有点的总和。
我正在使用 OpenCV 的 calibrateCamera
并试图了解它如何计算重投影误差以及该误差代表什么。它似乎是投影点和测量图像点之间的(欧几里得)距离的 RMS——对吗?然而,最终的重投影误差为 "minimized" 意味着什么? calibrateCamera()
是否明确使用函数 projectPoints()
来查找投影点?
重投影误差是用估计的内在和外在矩阵重投影的3D点与通过某些图像处理技术检测到的2D图像点(例如棋盘图案的角)之间的误差(例如欧氏距离)。
最终的重投影误差被最小化,因为估计内在和外在参数集的问题是一个非线性问题,因此您必须迭代地找到使这个重投影误差最小化的参数集。
更多信息:A Flexible New Technique for Camera Calibration ; Zhengyou Zhang ; 2000.
我指的是 OpenCV 版本 3.1.0,在这里你可以找到 calibrateCamera
的文档
http://docs.opencv.org/3.1.0/d9/d0c/group__calib3d.html#ga687a1ab946686f0d85ae0363b5af1d7b 并且文档说(粗体是我的):
The algorithm performs the following steps:
Compute the initial intrinsic parameters (the option only available for planar calibration patterns) or read them from the input parameters. The distortion coefficients are all set to zeros initially unless some of CV_CALIB_FIX_K? are specified.
Estimate the initial camera pose as if the intrinsic parameters have been already known. This is done using solvePnP .
Run the global Levenberg-Marquardt optimization algorithm to minimize the reprojection error, that is, the total sum of squared distances between the observed feature points imagePoints and the projected (using the current estimates for camera parameters and the poses) object points objectPoints. See projectPoints for details.
The function returns the final re-projection error.
无论如何,与其依赖文档,我更愿意看一下代码:
https://github.com/Itseez/opencv/blob/3.1.0/modules/calib3d/src/calibration.cpp#L3298
当您使用projectPoints
时,您需要在重投影后手动计算RMS。这可能会有所帮助。
OPENCV: Calibratecamera 2 reprojection error and custom computed one not agree
这是 OpenCV 代码 calibrate.cpp 第 1629 行的重投影误差计算:
return std::sqrt(reprojErr/total);
其中 total 是所有图像的所有点的总和。