OpenCV 中 undistortPoints() 和 projectPoints() 的区别

Difference between undistortPoints() and projectPoints() in OpenCV

根据我的理解,undistortPoints 在失真图像上获取一组点,并计算它们的坐标在同一图像的未失真版本上的位置。同样,projectPoints 将一组对象坐标映射到它们对应的图像坐标。

但是,我不确定 projectPoints 是否将对象坐标映射到失真图像(即原始图像)或未失真图像(直线)上的一组图像点?

此外,undistortPoints 的 OpenCV 文档指出 'the function performs a reverse transformation to projectPoints()'。你能解释一下这是怎么回事吗?

引自 projectPoints() 的 3.2 文档:

Projects 3D points to an image plane.

The function computes projections of 3D points to the image plane given intrinsic and extrinsic camera parameters.

你有参数distCoeffs:

If the vector is empty, the zero distortion coefficients are assumed.

在没有失真的情况下,等式是:

使用 K 内在矩阵和 [R | t] 外在矩阵或将对象或世界坐标系中的点转换为相机坐标系的变换。


对于undistortPoints(),你有参数R:

Rectification transformation in the object space (3x3 matrix). R1 or R2 computed by cv::stereoRectify can be passed here. If the matrix is empty, the identity transformation is used.

反向变换是使用内部参数为 2D 图像点 ([u, v]) 计算归一化相机帧 ([x, y, z=1]) 中相应的 3D 点的操作。

利用外部矩阵,可以得到相机坐标系中的点:

归一化相机帧除以深度得到:

假设没有失真,图像点为:

并且 "reverse transformation" 假设没有失真: