thierrymalon / DBoW2

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

Given scores are different when launching demoSift several times #1

Closed thierrymalon closed 9 years ago

thierrymalon commented 9 years ago

When launching demoSift with default parameters twice, the scores are not the same:

rm *.desc
rm small_voc.yml.gz
demoSift
demoSift
thierrymalon commented 9 years ago

In fact, the BinaryFile was written but never closed. Just after being written, it was read to load the descriptors, but as it seems to be saved only after receiving a certain amount of data of after being closed, the read descriptors were not full.

In addition, the descriptors are composed of float, but are saved in the Binary File as char. As the descriptors are composed of values between 0 and 255, they were loaded negative as char when a value exceeds 128.

Several solutions could have been adopted, like overloading the >> operator with unsigned char, or adding 256 to negative loaded descriptor values. We simply chose to write and read float values in the descriptors files.