Skip to content

Commit

Permalink
fix bugs as suggested at: raulmur/ORB_SLAM2#59
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenzhen.xiang committed Jun 4, 2020
1 parent 9207b77 commit 1e6a52a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion orb_slam2/src/Initializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -887,10 +887,12 @@ int Initializer::CheckRT(const cv::Mat &R, const cv::Mat &t, const vector<cv::Ke

vCosParallax.push_back(cosParallax);
vP3D[vMatches12[i].first] = cv::Point3f(p3dC1.at<float>(0),p3dC1.at<float>(1),p3dC1.at<float>(2));
nGood++;

if(cosParallax<0.99998)
{
vbGood[vMatches12[i].first]=true;
nGood++;
}
}

if(nGood>0)
Expand Down
2 changes: 1 addition & 1 deletion orb_slam2/src/ORBmatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ int ORBmatcher::SearchForInitialization(Frame &F1, Frame &F2, vector<cv::Point2f
float rot = F1.mvKeysUn[i1].angle-F2.mvKeysUn[bestIdx2].angle;
if(rot<0.0)
rot+=360.0f;
int bin = round(rot*factor);
int bin = round(rot/(360.0f*factor));
if(bin==HISTO_LENGTH)
bin=0;
assert(bin>=0 && bin<HISTO_LENGTH);
Expand Down

2 comments on commit 1e6a52a

@cyclojc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow, my problem was solved immediately, thanks for the bug fix!

@balisujohn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixed the problem for me as well. Thanks for your help!

Please sign in to comment.