title: kmeans:Required argument 'flags' (pos 6) not found
body: <p>I want to compute the lbp's cluster by kmeans. 
  first I compute the lbp value in size 8 * 8 every image.
  then I use the cv2.kmeans,but It can't work
  the error:Required argument 'flags' (pos 6) not found
  code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code># -*- coding: utf-8 -*-
  """
  Spyder Editor
  
  This temporary script file is located here:
  /home/nel/.spyder2/.temp.py
  """
  from skimage.feature import local_binary_pattern
  from skimage import io
  from skimage.color import rgb2gray
  import numpy as np
  import cv2
  
  def loadImages(path):
      import os
      imagePaths = map(lambda a:os.path.join(path,a),os.listdir(path))
      images = map(io.imread,imagePaths)
      return imagePaths,images
      
  def lbpdesc(imagename):
      radius = 1
      n_points = 8
      METHOD = 'nri_uniform'
      imagename = io.imread('/home/nel/project/pictest/1.jpg')
      gray_image = rgb2gray(imagename)
      lbp_height,lbp_width = gray_image.shape
      grid_rows = 8
      grid_cols = 8
      py = int(np.floor(lbp_height/grid_rows))
      px = int(np.floor(lbp_width/grid_cols))
      E = np.zeros((py*px,64))
      i = 0
      for row in range(0,py):
          for col in range(0,px):
              block =gray_image[row*grid_rows:(row+1)*grid_rows,col*grid_cols:(col+1)*grid_cols]
              H = local_binary_pattern(block,n_points,radius,METHOD)
              E[i,:] = H.ravel()
              i+=1
      return E
  
  if __name__ =="__main__":
      images = {}
      imagePath,imagesed = loadImages("/home/nel/project/pictest")
      for i in range(len(imagePath)):
          images[imagePath[i]] = imagesed[i]
      
      features = {}
      
      for d,x in images.items():
          features[d] = lbpdesc(x)
      featureall = np.float32(np.vstack(features.values()))
      
      codebookSize = 40
      
      iterMax = 100
      term_crit = (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT,10,1)
      retval,bestLabels,codebook = cv2.kmeans(featureall,codebookSize,term_crit,iterMax,cv2.KMEANS_RANDOM_CENTERS)
      
      </code></pre>
  </div>
  </div>
  </p>
  
  <p>the error:Required argument 'flags' (pos 6) not found.Why, I need your advise.</p>