【发布时间】:2012-06-19 08:11:25
【问题描述】:
我使用以下对 openCV 函数的调用来执行 K-means 算法:
cvKMeans2(points, count, &clusters, cvTermCriteria( CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 10, 1.0 ), 1, CV_KMEANS_USE_INITIAL_LABELS, centers);
在哪里
image2 = cvLoadImage( "lab.jpg", 0);
points = cvCreateMat( image2->height, image2->width, CV_32FC1 );
cvConvert(image2, points);
//count= number of clusters.
CvMat* centers; // To store the center of each cluster. (output).
lab.jpg 是 CIE L*a*b* 格式的图像。
但是上面这行,在编译的时候,显示如下错误:
`CV_KMEANS_USE_INITIAL_LABELS' undeclared (first use in this function)
too many arguments to function `cvKMeans2'
如果有人能指出哪里错了,尤其是第一个错误,即 KMEANS_USE_INITIAL_LABELS undeclared,那将非常有帮助。
提前致谢!
【问题讨论】: