Loop Closure Detection

namespace: lcdetection

Due to noise, the tracking results will definitely have some errors, which means that after scanning a circle, they may not return to the original point. Therefore, ghosts will appear in final model. Loop closure detection is used to check if the current scanned image and the previous scan are the same place by compute the similarity of image, and provide constraints for the global pose optimization to global consistency.

There are many loop closure detection methods, including 2D and 3D. At present, OnePiece only introduces MILD, which is a 2D loop closure detection based on multi-index hash. We use MILD to provide a series of similar frame, and odometry::SparseTracking will be further used to check if they are the correct correspondence. Because loop closure detection removes most of the outlier, the time consumed can be greatly reduced.

OnePiece encapsulates MILD into a class MildLCDetector, the main member functions are:

//Find possible repeated scenes for the current frame, input is the current frame
//The output is a collection of IDs of frames in the database that may be repeated scenes
void SelectCandidates(const geometry::RGBDFrame &frame, std::vector<int> &candidates);
//insert a frame into database
void Insert(const geometry::RGBDFrame &frame);

More loop closure detection methods may be added later.