MCPcopy Create free account
hub / github.com/UZ-SLAMLab/ORB_SLAM3 / ComputeKeyPointsOctTree

Method ComputeKeyPointsOctTree

src/ORBextractor.cc:781–896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

779 }
780
781 void ORBextractor::ComputeKeyPointsOctTree(vector<vector<KeyPoint> >& allKeypoints)
782 {
783 allKeypoints.resize(nlevels);
784
785 const float W = 35;
786
787 for (int level = 0; level < nlevels; ++level)
788 {
789 const int minBorderX = EDGE_THRESHOLD-3;
790 const int minBorderY = minBorderX;
791 const int maxBorderX = mvImagePyramid[level].cols-EDGE_THRESHOLD+3;
792 const int maxBorderY = mvImagePyramid[level].rows-EDGE_THRESHOLD+3;
793
794 vector<cv::KeyPoint> vToDistributeKeys;
795 vToDistributeKeys.reserve(nfeatures*10);
796
797 const float width = (maxBorderX-minBorderX);
798 const float height = (maxBorderY-minBorderY);
799
800 const int nCols = width/W;
801 const int nRows = height/W;
802 const int wCell = ceil(width/nCols);
803 const int hCell = ceil(height/nRows);
804
805 for(int i=0; i<nRows; i++)
806 {
807 const float iniY =minBorderY+i*hCell;
808 float maxY = iniY+hCell+6;
809
810 if(iniY>=maxBorderY-3)
811 continue;
812 if(maxY>maxBorderY)
813 maxY = maxBorderY;
814
815 for(int j=0; j<nCols; j++)
816 {
817 const float iniX =minBorderX+j*wCell;
818 float maxX = iniX+wCell+6;
819 if(iniX>=maxBorderX-6)
820 continue;
821 if(maxX>maxBorderX)
822 maxX = maxBorderX;
823
824 vector<cv::KeyPoint> vKeysCell;
825
826 FAST(mvImagePyramid[level].rowRange(iniY,maxY).colRange(iniX,maxX),
827 vKeysCell,iniThFAST,true);
828
829 /*if(bRight && j <= 13){
830 FAST(mvImagePyramid[level].rowRange(iniY,maxY).colRange(iniX,maxX),
831 vKeysCell,10,true);
832 }
833 else if(!bRight && j >= 16){
834 FAST(mvImagePyramid[level].rowRange(iniY,maxY).colRange(iniX,maxX),
835 vKeysCell,10,true);
836 }
837 else{
838 FAST(mvImagePyramid[level].rowRange(iniY,maxY).colRange(iniX,maxX),

Callers

nothing calls this directly

Calls 4

computeOrientationFunction · 0.85
resizeMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected