ZBLOG

你好, cv::Mat undistortedImage; cv::undistort(input_img, undistortedImage, cameraMatrix, distCoeffs);对于这个图片去畸变的操作。能不能对于点(x,y)也进行去畸变的同等变换

是的,可以对给定的点坐标(x, y)进行与图片去畸变相同的变换。可以使用cv::undistortPoints函数来实现这个操作。以下是一个示例代码:

// 输入的畸变图像坐标点
std::vector<cv::Point2f> distortedPoints;
distortedPoints.push_back(cv::Point2f(x, y));

// 输出的去畸变后的坐标点
std::vector<cv::Point2f> undistortedPoints;

// 进行去畸变操作
cv::undistortPoints(distortedPoints, undistortedPoints, cameraMatrix, distCoeffs);

// 去畸变后的坐标点(x', y')
float undistortedX = undistortedPoints[0].x;
float undistortedY = undistortedPoints[0].y;

注意,输入的畸变图像坐标点需要以cv::Point2f类型存储在distortedPoints中,输出的去畸变后的坐标点将会存储在undistortedPoints中,并可以通过访问其中元素获取去畸变后的具体坐标值(x’, y’)。


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://sdn.0voice.com/?id=3977

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?