dorian3d / DLoopDetector

Fast loop detector for sequences of monocular images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compile error caused by getDatabase().load("dbfile")

qh-huang opened this issue · comments

commented

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.