Merge pull request #2026 from pemmanuelviel:giveFurthestPoint

This commit is contained in:
Roman Donchenko 2014-03-18 13:40:43 +04:00 committed by OpenCV Buildbot
commit bfb1ba371c

View File

@ -759,10 +759,13 @@ private:
for (int k=0; k<indices_length; ++k) {
if (belongs_to[k]==j) {
belongs_to[k] = i;
count[j]--;
count[i]++;
break;
// for cluster j, we move the furthest element from the center to the empty cluster i
if ( distance_(dataset_[indices[k]], dcenters[j], veclen_) == radiuses[j] ) {
belongs_to[k] = i;
count[j]--;
count[i]++;
break;
}
}
}
converged = false;