From d3ac1bc314136d0654fad24a9ee5b01c29e9f5af Mon Sep 17 00:00:00 2001
From: Pierre-Emmanuel Viel
Date: Fri, 20 Dec 2013 01:00:55 +0100
Subject: [PATCH] When a cluster is empty for KMeans, it's better to give it
the point from another cluster j that is the furthest one from center j.
---
modules/flann/include/opencv2/flann/kmeans_index.h | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/modules/flann/include/opencv2/flann/kmeans_index.h b/modules/flann/include/opencv2/flann/kmeans_index.h
index 3fea956a74..489ed80565 100644
--- a/modules/flann/include/opencv2/flann/kmeans_index.h
+++ b/modules/flann/include/opencv2/flann/kmeans_index.h
@@ -759,10 +759,13 @@ private:
for (int k=0; k