thierrymalon / DBoW2

Enhanced hierarchical bag-of-word library for C++
Other
1 stars 0 forks source link

Improve database querying robustness #5

Closed thierrymalon closed 9 years ago

thierrymalon commented 9 years ago

A segmentation fault occurs when one of the n best matching scores is equal to 0.

When testing different values of k and L, it appears that when k^L is not of the order of the number of features found on dataset images, the matching scores are really low and sometimes real 0, giving a segmentation fault when asking the database for the n best matches.

For example, with the default parameters example but k = 10 and L = 6, the scores are such as image i is matching with image i with a score of 1, and a score of 0 with images j (j different of i). The first best match is well giving, and a segmentation fault occurs just after.

thierrymalon commented 9 years ago

This bug seemed to have been there from the beginning of demoSift.cpp but I never noticed it... It should be OK now. For example, when building a 10^4 vocabulary with only the four default images and querying the database:

Searching for Image 0: image2.png... Found: image2.png with score 1

Searching for Image 1: image1.png... Found: image1.png with score 1

Searching for Image 2: image0.png... Found: image0.png with score 1
Searching for Image 2: image0.png... Found: image3.png with score 0.000253833

Searching for Image 3: image3.png... Found: image3.png with score 1
Searching for Image 3: image3.png... Found: image0.png with score 0.000253833