title: OpenCV kmeans: N>=K exception , error (-215)
body: <p>My code is following  : </p>
  
  <pre><code>Mat cflow; /*computed optical flow */
  
  Mat p = Mat::zeros ( cflow.cols* cflow.rows, 5, CV_32F);
  ...
  ...( initializations of p ) 
  ...
  
  
  int K = 10;
  cv::kmeans(p,K,bestLabels,TermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 10,1.0),3,KMEANS_PP_CENTERS,centers);
  </code></pre>
  
  <p>And I come up with the following error: </p>
  
  <blockquote>
    <p>error: (-215) N >= K in function K means . </p>
  </blockquote>
  
  <p>Obviously N>=K , but how can I reshape it so that it works ?? </p>