gaoxiang12 / slambook2

edition 2 of the slambook
MIT License
5.49k stars 2.01k forks source link

Question about ch13 (Practice: Stereo Visual Odometry) #250

Closed TakuOkawara closed 2 years ago

TakuOkawara commented 2 years ago

I am a beginner at visual SLAM. Your codes and textbook are very useful for me to learn visual SLAM, thank you.

I have a question about "Practice: Stereo Visual Odometry". I wonder how these codes identify the same landmark between keyframes in these codes (ch13).

In my understanding, feature matching is done between the current frame and the last frame (only adjacent keyframes). Then, In TriangulateNewPoints() at frontend.cpp, new feature including in currentframe is accumulated to map. And then, map (each landmark) includes feature point position, keyframeid and landmark position, and landmark id (id). Finally, the edges between the pose of the keyframe and the position of the landmark are set.

I read almost part of these codes, however, I am not sure how these codes identify the same landmark between keyframes. For example, how do these codes identify ID4 landmark between KF3 and KF5 (as attached figure)?

If my explanation is insufficient, please point out that. Screenshot from 2022-09-20 04-31-41

Weiyi-Zhang258 commented 1 year ago

image In this code, the positions where old feature points exist are masked. Thus the feature points extracted by GFTT are all new ones.

TakuOkawara commented 1 year ago

Thank you for your polite explanation. I have understood how to detect only new features.

I am learning visual slam with these codes and slambook because these codes and the book are clearly written. Thank you for giving us amazing tools.

Weiyi-Zhang258 commented 1 year ago

Welcome friend, I'm glad to be helpful. And I am a beginner, too. The book and codes are really great to start with.