Commit bfb1ba37 authored by Roman Donchenko's avatar Roman Donchenko Committed by OpenCV Buildbot

Merge pull request #2026 from pemmanuelviel:giveFurthestPoint

parents a489d86e d3ac1bc3
...@@ -759,10 +759,13 @@ private: ...@@ -759,10 +759,13 @@ private:
for (int k=0; k<indices_length; ++k) { for (int k=0; k<indices_length; ++k) {
if (belongs_to[k]==j) { if (belongs_to[k]==j) {
belongs_to[k] = i; // for cluster j, we move the furthest element from the center to the empty cluster i
count[j]--; if ( distance_(dataset_[indices[k]], dcenters[j], veclen_) == radiuses[j] ) {
count[i]++; belongs_to[k] = i;
break; count[j]--;
count[i]++;
break;
}
} }
} }
converged = false; converged = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment