I use the following call to the openCV function to execute the K-means algorithm:
cvKMeans2(points, count, &clusters, cvTermCriteria( CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 10, 1.0 ), 1, CV_KMEANS_USE_INITIAL_LABELS, centers);
Where
image2 = cvLoadImage( "lab.jpg", 0); points = cvCreateMat( image2->height, image2->width, CV_32FC1 ); cvConvert(image2, points);
lab.jpg is a CIE L * a * b * image.
But the above line when compiling shows the following errors:
`CV_KMEANS_USE_INITIAL_LABELS' undeclared (first use in this function) too many arguments to function `cvKMeans2'
It would be very helpful if someone can point out where it is wrong, especially the first error, which says that KMEANS_USE_INITIAL_LABELS is not declared.
Thanks in advance!
source share