当前位置:网站首页>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;
}
边栏推荐
- ECMAScript 2022 正式发布,有你了解过的吗?
- 安全(2)
- 6-24漏洞利用-vnc密码破解
- H5页面打开微信小程序
- Redis cluster mode
- Some insights from 5 years of automated testing experience: UI automation must overcome these 10 pits
- 管理基础知识17
- About MySQL data insertion (advanced usage)
- 期货公司开户实力经纪业务的规模
- Anti-oversold and high concurrent deduction scheme for e-commerce inventory system
猜你喜欢

浅谈国产ERP的“横纵竖”三向发展态势

期货开户是否有资金门槛?

Debian侵犯Rust商标,妥协改名还是会得到豁免?

Flask gets post request parameters

微信支付软件架构,这也太牛逼了!

Can‘t connect to MySQL server on ‘localhost3306‘ (10061) 简洁明了的解决方法

datagrip连接mysql数据库

C语言实验九 函数(一)

Test Cases: Four-Step Test Design Approach

Why is on-chain governance so important, and how will Polkadot Gov 2.0 lead the development of on-chain governance?
随机推荐
dbeaver连接MySQL数据库及错误Connection refusedconnect处理
传统企业数字化转型需要经过几个阶段?
Two ways to pass feign exceptions: fallbackfactory and global processing Get server-side custom exceptions
21.数据增强
Pytorch seq2seq model architecture to achieve English translation tasks
Moonbeam与Project Galaxy集成,为社区带来全新的用户体验
管理基础知识14
ALCCIKERS Shane 20191114
期货开户调整交易所保证金标准
Kubernetes — 网络流量模型
管理基础知识17
Mapped Statements collection does not contain value for的解决方法
外包干了三年,废了...
C语言实验九 函数(一)
Rust P2P网络应用实战-1 P2P网络核心概念及Ping程序
Test Cases: Four-Step Test Design Approach
如何期货开户和选择期货公司?
Entry name ‘org/apache/commons/codec/language/bm/gen_approx_greeklatin.txt’ collided
Debian侵犯Rust商标,妥协改名还是会得到豁免?
H5画布 canvas(一)canvas简介、绘制圆形矩形、案例饼状图绘制