rmsalinas / DBow3

Improved version of DBow2
Other
507 stars 238 forks source link

fixing centroids override by using cv::mat deep copy #53

Open yinonb4 opened 1 year ago

yinonb4 commented 1 year ago

Hi as part of working and improving orb slam 3, we encountered a bug in assigning new centroids to the voc tree.

we offer simple and clean solution to this in the following commit.

when creating a new voc tree from around 1 million features in the orbslam3 voc.txt, we found that features which are selected as cluster centers during the k-medians are mutated, meaning the leaves that are supposed to represent those features actually hold the mutated version (cluster centers). for example, in a tree with around 900k leaves, we noticed about 200k were mutated.

this damaged the correctness of the voc tree, since we needed to assign weights to each feature/leaf, using the original voc.txt weights. this means mutated features had no correct weights. after this change, we notice no original feature was mutated.