mariusmuja/flann — pull request #152 by pemmanuelviel (2013-12-13 13:51:35+00:00)
Title: Better results with centers far from each other when selecting them in the chooseCentersKMeanspp stage

Hi,
I've noticed in the OpenCV version of Flann that when choosing centers with KMeansPP we don't use the squared distance of a point to previous centers, but just its simple distance, to set probabilities proportionality for picking up this point as new center candidate.

According to the original article of KMeans++ and following Gonzales intuition that it's better to initialize new centers candidates far from previous centers, I obtain better results with distance^2.

Here are my small modifications...