当前位置:网站首页>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;
}
边栏推荐
- 3 Month Tester Readme: 4 Important Skills That Impacted My Career
- 微信支付软件架构,这也太牛逼了!
- 管理基础知识11
- Two ways to pass feign exceptions: fallbackfactory and global processing Get server-side custom exceptions
- Why is on-chain governance so important, and how will Polkadot Gov 2.0 lead the development of on-chain governance?
- Pcie the inbound and outbound
- canal实现mysql数据同步
- input禁止输入
- Redis和MySQL数据一致性问题,有没有好的解决方案?
- 哈希表
猜你喜欢
随机推荐
GateWay实现负载均衡
5年自动化测试经验的一些感悟:做UI自动化一定要跨过这10个坑
Maxwell 一款简单易上手的实时抓取Mysql数据的软件
期货开户手续费加一分是主流
C语言实验十 函数(二)
Flink_CDC construction and simple use
C语言实验九 函数(一)
安全(2)
IDEA找不到Database解决方法
如何期货开户和选择期货公司?
canal实现mysql数据同步
PHP直播源码实现简单弹幕效果的相关代码
C语言实验八 字符数组程序设计
好的期货公司开户让人省心省钱
MInIO入门-03 秒传+大文件分片上传
大话西游创建角色失败解决
Kubernetes — Calico
FlinkSQL CDC实现同步oracle数据到mysql
管理基础知识13
MySQL——增删查改操作








