当前位置:网站首页>[ORB_SLAM2] void Frame::ComputeImageBounds(const cv::Mat & imLeft)
[ORB_SLAM2] void Frame::ComputeImageBounds(const cv::Mat & imLeft)
2022-08-02 02:00:00 【Xiaoqiu SLAM practical tutorial】
ComputeImageBoundsThe main purpose of this function is to get to the scope of the distortion after image coordinates,For subsequent meshing boundary value,This function will only be in the first frame come in or internal changed is called,Here the boundary value of selected using the maximum coverage criterion,Which is the top left corner in small,The lower right corner to take big,Which can cover the whole to distortion after image
void Frame::ComputeImageBounds(const cv::Mat &imLeft)
{
// 如果畸变参数不为0,用OpenCV函数进行畸变矫正
if(mDistCoef.at<float>(0)!=0.0)
{
// Save the correct image in front of the four boundary point coordinates: (0,0) (cols,0) (0,rows) (cols,rows)
cv::Mat mat(4,2,CV_32F);
mat.at<float>(0,0)=0.0; //左上
mat.at<float>(0,1)=0.0;
mat.at<float>(1,0)=imLeft.cols; //右上
mat.at<float>(1,1)=0.0;
mat.at<float>(2,0)=0.0; //左下
mat.at<float>(2,1)=imLeft.rows;
mat.at<float>(3,0)=imLeft.cols; //右下
mat.at<float>(3,1)=imLeft.rows;
// Undistort corners
// Operation and calibration feature points in front,Will this a few boundary points as the input for correction
mat=mat.reshape(2);
cv::undistortPoints(mat,mat,mK,mDistCoef,cv::Mat(),mK);
mat=mat.reshape(1);
//After correction of the four boundary point is not able to round into a rigid rectangular,So add borders as coordinates on the outside of the quadrilateral boundary
mnMinX = min(mat.at<float>(0,0),mat.at<float>(2,0));//左上和左下横坐标最小的
mnMaxX = max(mat.at<float>(1,0),mat.at<float>(3,0));//右上和右下横坐标最大的
mnMinY = min(mat.at<float>(0,1),mat.at<float>(1,1));//左上和右上纵坐标最小的
mnMaxY = max(mat.at<float>(2,1),mat.at<float>(3,1));//左下和右下纵坐标最小的
}
else
{
// If the distortion parameters as0,Direct access to the image boundary
mnMinX = 0.0f;
mnMaxX = imLeft.cols;
mnMinY = 0.0f;
mnMaxY = imLeft.rows;
}
}

边栏推荐
- 【ORB_SLAM2】void Frame::ComputeImageBounds(const cv::Mat &imLeft)
- 三本毕业的我被腾讯拒绝了十四次,最终成功入职阿里
- MySQL8 下载、启动、配置、验证
- 大话西游无法登陆解决
- 5年自动化测试经验的一些感悟:做UI自动化一定要跨过这10个坑
- Anti-oversold and high concurrent deduction scheme for e-commerce inventory system
- typescript30 - any type
- 个人博客系统项目测试
- Moonbeam与Project Galaxy集成,为社区带来全新的用户体验
- typescript33-typescript高级概述
猜你喜欢

YGG Guild Development Plan Season 1 Summary

"NetEase Internship" Weekly Diary (2)

个人博客系统项目测试

6-25漏洞利用-irc后门利用

制造企业数字化转型现状分析

Yunhe Enmo: Let the value of the commercial database era continue to prosper in the openGauss ecosystem

记录一次数组转集合出现错误的坑点,尽量使用包装类型数组进行转换

Redis Subscription and Redis Stream

用位运算为你的程序加速

Constructor of typescript35-class
随机推荐
云和恩墨:让商业数据库时代的价值在openGauss生态上持续繁荣
字节给我狠狠上了一课:危机来的时候你连准备时间都没有...
Pcie the inbound and outbound
Day116.尚医通:预约挂号详情 ※
LeetCode brush diary: LCP 03. Machine's adventure
Fundamentals of Cryptography: X.690 and Corresponding BER CER DER Encodings
Data transfer at the data link layer
一本适合职场新人的好书
哈希表
YGG Guild Development Plan Season 1 Summary
When paying attention to the "Internet +" model, you usually only focus on the "Internet +" model itself
typescript29-枚举类型的特点和原理
当关注「互联网+」模式的时候,通常仅仅只是在关注「互联网+」模式本身
求大神解答,这种 sql 应该怎么写?
个人博客系统项目测试
哈希冲突和一致性哈希
牛顿定理和相关推论
LeetCode刷题日记:53、最大子数组和
Chengdu openGauss user group recruit!
Constructor instance method of typescript36-class