Skip to content

Commit

Permalink
Fix important bug
Browse files Browse the repository at this point in the history
  • Loading branch information
raulmur committed Oct 15, 2015
1 parent dcf4f86 commit 5a6f862
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Thirdparty/DBoW2/DBoW2/TemplatedVocabulary.h
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,8 @@ bool TemplatedVocabulary<TDescriptor,F>::loadFromTextFile(const std::string &fil

int nid = m_nodes.size();
m_nodes.resize(m_nodes.size()+1);

m_nodes[nid].id = nid;

int pid ;
ssnode >> pid;
m_nodes[nid].parent = pid;
Expand All @@ -1393,10 +1394,14 @@ bool TemplatedVocabulary<TDescriptor,F>::loadFromTextFile(const std::string &fil
int nIsLeaf;
ssnode >> nIsLeaf;

string sd;
stringstream ssd;
for(int iD=0;iD<F::L;iD++)
ssnode >> sd;
F::fromString(m_nodes[nid].descriptor, sd);
{
string sElement;
ssnode >> sElement;
ssd << sElement << " ";
}
F::fromString(m_nodes[nid].descriptor, ssd.str());

ssnode >> m_nodes[nid].weight;

Expand Down

0 comments on commit 5a6f862

Please sign in to comment.