当前位置:网站首页>bool框架::PosInGrid (const简历:关键点kp, int &posX, int诗句)

bool框架::PosInGrid (const简历:关键点kp, int &posX, int诗句)

2022-08-02 02:00:00 Xiaoqiu SLAM practical tutorial

bool Frame::PosInGrid(const cv::KeyPoint &kp, int &posX, int &posY){// The corrected four boundary points can no longer form a strict rectangle, so a frame is added to the outside of this quadrangle as the boundary of the coordinates// mnMinX = min(mat.at(0,0),mat.at(2,0));//The smallest upper left and lower left abscissa// mnMaxX = max(mat.at(1,0),mat.at(3,0));//The largest abscissa of the upper right and lower right// mnMinY = min(mat.at(0,1),mat.at(1,1));//The smallest upper left and upper right ordinate// mnMaxY = max(mat.at(2,1),mat.at(3,1));//The smallest ordinate of the lower left and lower right// mfGridElementWidthInv=static_cast(FRAME_GRID_COLS)/static_cast(mnMaxX-mnMinX); how many image grid columns are equivalent to one image pixel// mfGridElementHeightInv=static_cast(FRAME_GRID_ROWS)/static_cast(mnMaxY-mnMinY); how many image grid row heights are equivalent to one image pixelposX = round((kp.pt.x-span>mnMinX)*mfGridElementWidthInv);posY = round((kp.pt.y-span>mnMinY)*mfGridElementHeightInv);//Keypoint's coordinates are undistorted, which could cause to go out of the imageif(posX<0 || posX>=FRAME_GRID_COLS || posY<0 || posY>=FRAME_GRID_ROWS)return false;return true;}
原网站

版权声明
本文为[Xiaoqiu SLAM practical tutorial]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/214/202208020104559406.html