A rigorous statistical approach for centroids determination