# Revision history [back]

### how to get new center points in kmeans

hi,

trying to get new center points of newly created clusters with kmeans function. applying kemeans function as below;

kmeans(tmpsp[1], 4, labels, TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 10, 1.0/*CV_TERMCRIT_ITER, 1, 1.0*/), 3, KMEANS_RANDOM_CENTERS, newCenters);


and this is tmpsp[1] dataset (actually it is an image with the size of 91x53, and the type is CV_32F);

this is labels, it contains numbers from 0 to (cluster count-1), it is in size of 1x53;

and this is newCenters, matrix in size of 94x53;

1) how can i get centroids of found clusters? i need accurate x and y points for each clusters. 2) how can I give initial centroids?

thanks.