当前位置:网站首页>[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;
}
}
边栏推荐
- 软件测试 接口自动化测试 pytest框架封装 requests库 封装统一请求和多个基础路径处理 接口关联封装 测试用例写在yaml文件中 数据热加载(动态参数) 断言
- typescript35-class的构造函数
- Redis Subscription and Redis Stream
- LeetCode刷题日记: 33、搜索旋转排序数组
- LeetCode刷题日记:LCP 03.机器人大冒险
- The characteristics and principle of typescript29 - enumeration type
- HSDC和独立生成树相关
- 【刷题篇】打家劫舍
- 飞桨助力航天宏图PIE-Engine地球科学引擎构建
- 力扣(LeetCode)213. 打家劫舍 II(2022.08.01)
猜你喜欢
Check if IP or port is blocked
Fly propeller power space future PIE - Engine Engine build earth science
软件测试功能测试全套常见面试题【开放性思维题】面试总结4-3
Fundamentals of Cryptography: X.690 and Corresponding BER CER DER Encodings
制造企业数字化转型现状分析
超大规模的产业实用语义分割数据集PSSL与预训练模型开源啦!
hash table
AOF rewrite
Golang分布式应用之定时任务
喜报 | AR 开启纺织产业新模式,ALVA Systems 再获殊荣!
随机推荐
电子制造仓储条码管理系统解决方案
使用百度EasyDL实现厂区工人抽烟行为识别
Hiring a WordPress Developer: 4 Practical Ways
"Introduction to Natural Language Processing Practice" Question Answering Robot Based on Knowledge Graph
6-25 Vulnerability Exploitation - irc Backdoor Exploitation
AOF重写
"NetEase Internship" Weekly Diary (3)
Golang分布式应用之定时任务
Fundamentals of Cryptography: X.690 and Corresponding BER CER DER Encodings
Check if IP or port is blocked
大话西游创建角色失败解决
typescript33 - high-level overview of typescript
Day116. Shangyitong: Details of appointment registration ※
【Brush the title】Family robbery
Chengdu openGauss user group recruit!
typescript31-any类型
Centos7 安装postgresql并开启远程访问
6-24 exploit-vnc password cracking
【服务器数据恢复】服务器Raid5阵列mdisk磁盘离线的数据恢复案例
搜罗汇总的效应