title: TypeError: Argument given by name ('k') and position (2)
body: <p>Find below my <code>opencv3</code> <strong>Python3</strong> code to match objects which raises the following error:</p>
  
  <blockquote>
    <p>TypeError: Argument given by name ('k') and position (2)</p>
  </blockquote>
  
  <p>Here's the code:</p>
  
  <pre><code>import numpy as np
  import cv2
  import time
  import distance
  camera = cv2.VideoCapture(0)
  sift = cv2.xfeatures2d.SIFT_create()
  img = cv2.imread('/home/shar/bo.jpg')
  imgTrainGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
  kpTrain = sift.detect(imgTrainGray,None)
  kpTrain, desTrain = sift.compute(imgTrainGray, kpTrain)
  FLANN_INDEX_KDTREE = 0
  index_params = dict(algorithm = FLANN_INDEX_KDTREE, trees = 5)
  search_params = dict(checks=50)  
  flann = cv2.FlannBasedMatcher(index_params,search_params)
  
  matches = flann.knnMatch(kpTrain,desTrain,k=2)
  </code></pre>
  
  <p>Ideas on how to fix it?</p>