Closed fredO13 closed 5 years ago
So how do you feel about fixing it? I am confused about what you said.
@fredO13 Hi, really appreciate it for reading my code so carefully and pointing out the bugs.
I've changed:
v_pts_2d[ith_frame].push_back(&(frame->keypoints_[kpt_idx].pt));
v_pts_2d_to_3d_idx[ith_frame].push_back(mappt_idx);
To:
v_pts_2d.back().push_back(&(frame->keypoints_[kpt_idx].pt));
v_pts_2d_to_3d_idx.back().push_back(mappt_idx);
@ouyangandy
Hey,
I think there's a bug in void VisualOdometry::callBundleAdjustment()
You're looping on the last 5 frames and there's a continue if the frame has less than 3 points in the map. Right below the continue are two _pushback on _v_pts_2d_ and _v_pts_to3d that are not done when continue happen, but the index is still _ithframe which may not exist in case continue was called before.
You may want to select the appropriate frames (the last 5 frames with enough points in the map) before calling the existing code, removing the continue.