Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/Vocabulary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
#include "quicklz.h"
#include <sstream>
#include "timers.h"

const int MAX_ITERATION = 100;

namespace DBoW3{
// --------------------------------------------------------------------------


Vocabulary::Vocabulary
(int k, int L, WeightingType weighting, ScoringType scoring)
: m_k(k), m_L(L), m_weighting(weighting), m_scoring(scoring),
Expand Down Expand Up @@ -263,9 +265,11 @@ void Vocabulary::HKmeansStep(NodeId parent_id,

// to check if clusters move after iterations
std::vector<int> last_association, current_association;

while(goon)

int count = 0;
while(goon && count < MAX_ITERATION)
{
count++;
// 1. Calculate clusters

if(first_time)
Expand Down