当前位置:网站首页>bool Frame::PosInGrid(const cv::KeyPoint &kp, int &posX, int &posY)
bool Frame::PosInGrid(const cv::KeyPoint &kp, int &posX, int &posY)
2022-08-02 01:05:00 【小秋SLAM实战教程】
bool Frame::PosInGrid(const cv::KeyPoint &kp, int &posX, int &posY)
{
// 校正后的四个边界点已经不能够围成一个严格的矩形,因此在这个四边形的外侧加边框作为坐标的边界
// 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));//左下和右下纵坐标最小的
// mfGridElementWidthInv=static_cast<float>(FRAME_GRID_COLS)/static_cast<float>(mnMaxX-mnMinX); 一个图像像素相当于多少个图像网格列宽
// mfGridElementHeightInv=static_cast<float>(FRAME_GRID_ROWS)/static_cast<float>(mnMaxY-mnMinY); 一个图像像素相当于多少个图像网格行高
posX = round((kp.pt.x-mnMinX)*mfGridElementWidthInv);
posY = round((kp.pt.y-mnMinY)*mfGridElementHeightInv);
//Keypoint's coordinates are undistorted, which could cause to go out of the image
if(posX<0 || posX>=FRAME_GRID_COLS || posY<0 || posY>=FRAME_GRID_ROWS)
return false;
return true;
}
边栏推荐
猜你喜欢
Docker安装canal、mysql进行简单测试与实现redis和mysql缓存一致性
flyway的快速入门教程
Navicat数据显示不完全的解决方法
PowerBI商学院佐罗BI真经连续剧
Local storage in Kubernetes
Rust P2P网络应用实战-1 P2P网络核心概念及Ping程序
Can't connect to MySQL server on 'localhost3306' (10061) Simple and clear solution
【ORB_SLAM2】void Frame::ComputeImageBounds(const cv::Mat &imLeft)
3个月测试员自述:4个影响我职业生涯的重要技能
Flex layout in detail
随机推荐
管理基础知识13
传统企业数字化转型需要经过几个阶段?
feign异常传递的两种方式 fallbackfactory和全局处理 获取服务端自定义异常
JS中localStorage和sessionStorage
第一次写对牛客的编程面试题:输入一个字符串,返回该字符串出现最多的字母
期货开户手续费的秘密成了透明
交返是做日内交易的必要条件
60种特征工程操作:使用自定义聚合函数【收藏】
"Introduction to Natural Language Processing Practice" Question Answering Robot Based on Knowledge Graph
电商库存系统的防超卖和高并发扣减方案
C语言:打印整数二进制的奇数位和偶数位
js中内存泄漏的几种情况
3个月测试员自述:4个影响我职业生涯的重要技能
ECMAScript 2022 正式发布,有你了解过的吗?
pcie inbound和outbound关系
DCM 中间件家族迎来新成员
期货公司开户实力经纪业务的规模
Pytorch seq2seq model architecture to achieve English translation tasks
Image fusion based on weighted 】 and pyramid image fusion with matlab code
input禁止输入