且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Python中使用OpenCV扭曲点时的不良结果

更新时间:2023-10-15 23:12:04

我认为您忘记了对undistortPoints的调用中指定了新相机矩阵.如果您查看函数的文档,它表示签名是:

I think you forgot to specify the new camera matrix in your call to undistortPoints. If you look at the documentation of the function, it says that the signature is:

Python: cv.UndistortPoints(src, dst, cameraMatrix, distCoeffs, R=None, P=None) → None

其中dst是未失真后的点的数组,并且如果P是同一性或省略,则它包含归一化的点坐标",即在使用校准矩阵在图像中投影之前.

where dst is the array of points after undistortion and "if P is identity or omitted, then it contains normalized point coordinates", meaning before projection in the image using the calibration matrix.

如果将P设置为cameraMatrix,则该功能应该可以实现预期的效果.

The function should do what you expect if you set P to your cameraMatrix.