multidimensional kmeans [closed]

asked 2016-04-18 07:18:33 -0500

thewoz gravatar image

updated 2016-04-18 10:35:51 -0500

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

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2016-04-18 11:27:13.897310