title: cv2.kmeans error with parameters -python
body: <p>I am somewhat new to cv2 and I am having the following error</p>
  
  <p>First, I obtain the ORB descriptors of an image with the following code:</p>
  
  <pre><code>import cv2
  img = cv2.imread('messi.jpg',0) 
  orb = cv2.ORB_create()
  cv2.ocl.setUseOpenCL(False)
  kp, des = orb.detectAndCompute(img, None)
  </code></pre>
  
  <p>The function detected 500 keypoints, each one with a dimentionality of 32. If I do:</p>
  
  <pre><code>des.shape
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>(500L,32L) 
  </code></pre>
  
  <p>Additionally, I want to get the centroids of the descriptors using kmeans. This is my code:</p>
  
  <pre><code>iterations = 10
  epsilon = 1.0
  k = 64
  criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, iterations, epsilon)
  compactness, labels, centers = cv2.kmeans(des, k ,None ,criteria, iterations, cv2.KMEANS_RANDOM_CENTERS)
  </code></pre>
  
  <p>The error I get is:</p>
  
  <pre><code> error: C:\builds\master_PackSlaveAddon-win64-vc12
   static\opencv\modules\core\src\kmeans.cpp:230: error: (-215) data0.dims &lt;= 2
   &amp;&amp; type == CV_32F &amp;&amp; K &gt; 0 in function cv::kmeans
  </code></pre>
  
  <p>I have seen threads on this error for C++, and it was usually a problem with the image dimensionality or the image type, but in python I am not sure what it means.</p>
  
  <p>Any help?</p>