Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

multidimensional kmeans

Hello to everyone,

I'm trying to run the kmeans algorithm on a n-dimensional data.

I Have N points and each point have { x, y, z, ... , n } features.

my code is the following:

cv::Mat points(N, n, CV_32F);

// fill the data points

cv::Mat labels; cv::Mat centers;

cv::kmeans(points, k, labels, cv::TermCriteria(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS, 1000, 0.001), 10, cv::KMEANS_PP_CENTERS, centers);

the problem is that the kmeans algorithm run into a segmentation fault.

any help is appreciated

multidimensional kmeans

Hello to everyone,

I'm trying to run the kmeans algorithm on a n-dimensional data.

I Have N points and each point have { x, y, z, ... , n } features.

my code is the following:

cv::Mat points(N, n, CV_32F);

// fill the data points

cv::Mat labels; cv::Mat centers;

cv::kmeans(points, k, labels, cv::TermCriteria(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS, 1000, 0.001), 10, cv::KMEANS_PP_CENTERS, centers);

the problem is that the kmeans algorithm run into a segmentation fault.

any help is appreciated

Update:

had made a mistake in the "fill the data points" so that I corrupts the memory