Compile error caused by getDatabase().load("dbfile")
qh-huang opened this issue · comments
I got compile error with following statement
BriefLoopDetector bld;
bld.getDatabase().load("file"); // this line always introduces compile error
the error message is
error: passing ‘const DBoW2::TemplatedDatabase<DUtils::dynamic_bitset<>, DBoW2::FBrief>
’ as ‘this’ argument of ‘void DBoW2::TemplatedDatabase<TDescriptor, F>::load(const
string&) [with TDescriptor = DUtils::dynamic_bitset<>; F = DBoW2::FBrief; std::string
= std::basic_string<char>]’ discards qualifiers [-fpermissive]
bls.getDatabase().load("file");
but I don't understand what's wrong with my code...
Any idea is appreciated, thanks.
Try this:
BriefDatabase db("file");
BriefLoopDetector bld;
bld.setDatabase(bld);
Check the demo application to see some full working code.