title: opencv multidimensional kmeans
body: <p>I'm trying to run the kmeans algorithm on a n-dimensional data.</p>
  
  <p>I Have N points and each point have <code>{ x, y, z, ... , n }</code> features.</p>
  
  <p>my code is the following:</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>the problem is that the kmeans algorithm run into a segmentation fault.</p>
  
  <p>any help is appreciated</p>
  
  <p><strong>update</strong></p>
  
  <p>How Miki and Micka said the above code was correct!</p>
  
  <p>I had made a mistake in the "fill the data points" so that I corrupts the memory</p>