rmsalinas / DBow3

Improved version of DBow2
Other
501 stars 237 forks source link

An error when running demo_general (The written string is too long in function icvYMLWriteString) #13

Open llloadinglll opened 6 years ago

llloadinglll commented 6 years ago

When I ran demo_general , there was an error occurred. Here is part of the output: " Saving database... 1 OpenCV Error: Bad argument (The written string is too long) in icvYMLWriteString, file /tmp/opencv3-20170727-41914-1s9pxfl/opencv-3.2.0/modules/core/src/persistence.cpp, line 2111 /tmp/opencv3-20170727-41914-1s9pxfl/opencv-3.2.0/modules/core/src/persistence.cpp:2111: error: (-5) The written string is too long in function icvYMLWriteString "

and I found that it was from the line ' f << "descriptor" << DescManip::toString(child.descriptor); ' in Vocabulary.cpp. "child.descriptor.cols()" was 32767 so the string was too long for operator<< . What confused me most is that in the debug mode of CLion , there is no error. But in the run mode there is.

And I found that if I changed the suffix from '.yml.gz' to '.voc' it could be solved.

tszssong commented 6 years ago

I came across the same problem when use only 2 images, use 4 images is ok. like this: ./demo_general orb ../../utils/images/image0.png ../../utils/images/image1.png ../../utils/images/image2.png ../../utils/images/image3.png

And the problem is finally solved by pull requests:https://github.com/rmsalinas/DBow3/pull/10