+1  A: 

This makes it look like the "centers" parameter has the same type as the first parameter, which other documentation says:

The metatype CvArr is used only as a function parameter to specify that the function accepts arrays of multiple types, such as IplImage*, CvMat* or even CvSeq* sometimes. The particular array type is determined at runtime by analyzing the first 4 bytes of the header.

That, combined with this question, makes me think you should try passing a CV array (vector) to get the centers.

John Zwinck
+1  A: 

In OpenCV 2.0, the equivalent kmeans function takes a CV_32FC1 matrix, but OpenCV 2.0 is quite a substantial upgrade to the old kmeans2 function, so I cannot be sure if the cluster centers datatype would still be the same for the OpenCV 1.1 version.

Ray Hidayat
Yes, I'm using CV_32FC1 matrix. But as I was thinking more about it, I finally realized it's quite simple, that it's the same type as input. Cause it's a vector of random numbers from the same range as my input floats.
Goffrey