I am reading the second step of tracking thread - feature location refinement
in function reprojectMap, I think the code firstly calls reprojectPoint twice (with close keyframes and later map point candidates)
after this, the grid (consistint of cells) is assigned
then the code goes through all the cells, calling reprojectCell with each one
in function reprojectCell, the code goes through all the candidates and calls findMatchDirect with each candidate
in function findMatchDirect, the information of variable "ref_ftr_" is used again and again.
Based on my understanding of the paper, "ref_ftr_" refers to the 2d feature point/patch in earlier key frames, which is realated to the candidate.
So, I think "ref_ftr_" should be different for different candidate
HERE COMES THE QUESTION
I type grep -r "ref_ftr_" * under the directory rpg_svo
the output is:
svo/test/test_matcher.cpp: ref_ftr_ = new svo::Feature(frame_ref_, Eigen::Vector2d(300, 260), 0);
svo/test/test_matcher.cpp: delete ref_ftr_;
svo/test/test_matcher.cpp: svo::Feature* ref_ftr_;
svo/test/test_matcher.cpp: Eigen::Vector2d px_cur(frame_cur_->cam_->world2cam(T_cur_ref_(ref_ftr_->f_depth)));
svo/test/test_matcher.cpp: cam, *cam_, ref_ftr_->px, ref_ftr_->f, 1.0, T_cur_ref, ref_ftr_->level, A_cur_ref);
svo/test/test_matcher.cpp: A_cur_ref, ref_ftr_->frame->img_pyr_[ref_ftr_->level], ref_ftr_->px,
svo/test/test_matcher.cpp: ref_ftr_->level, level_cur, matcher.halfpatch_size_+1, matcher.patch_with_border_);
svo/test/test_matcher.cpp: cv::circle(frame_ref_->img_pyr_[ref_ftr_->level],
svo/test/test_matcher.cpp: cv::Point2f(ref_ftr_->px[0]/(1<<ref_ftr_->level), ref_ftr_->px[1]/(1<<ref_ftr_->level)),
svo/test/test_matcher.cpp: cv::imshow("ref_img", frame_ref_->img_pyr_[ref_ftr_->level]);
svo/src/matcher.cpp: if(!pt.getCloseViewObs(cur_frame.pos(), ref_ftr_))
svo/src/matcher.cpp: if(!ref_ftr_->frame->cam_->isInFrame(
svo/src/matcher.cpp: ref_ftr_->px.cast()/(1<<ref_ftr_->level), halfpatch_size_+2, ref_ftr_->level))
svo/src/matcher.cpp: *ref_ftr_->frame->cam_, *cur_frame.cam_, ref_ftr_->px, ref_ftr_->f,
svo/src/matcher.cpp: (ref_ftr_->frame->pos() - pt.pos_).norm(),
svo/src/matcher.cpp: cur_frame.T_f_w_ * ref_ftr_->frame->T_f_w_.inverse(), ref_ftr_->level, A_cur_ref_);
svo/src/matcher.cpp: warp::warpAffine(A_cur_ref_, ref_ftr_->frame->img_pyr_[ref_ftr_->level], ref_ftr_->px,
svo/src/matcher.cpp: ref_ftr_->level, search_level_, halfpatch_size_+1, patch_with_border_);
svo/src/matcher.cpp: if(ref_ftr_->type == Feature::EDGELET)
svo/src/matcher.cpp: Vector2d dir_cur(A_cur_ref__ref_ftr_->grad);
svo/src/reprojector.cpp: if(matcher_.ref_ftr_->type == Feature::EDGELET)
svo/src/reprojector.cpp: new_feature->grad = matcher_.A_cur_ref__matcher_.ref_ftr_->grad;
svo/include/svo/matcher.h: Feature_ ref_ftr_;
So "ref_ftr_" is a member of class matcher, and "matcher_" is declared in "reprojector.h" without initialization.
That's what I cannot understand:
"ref_ftr_" is not initialized nor changed according to different candidate.
I don't know which feature is used for feature_alignment in later part or how to modify this.
Hope anyone could help me, THX in advance!