title: Sift comparison using python
body: <p>I need to calculate the percentage of similarity between two images, I found the part that does the calculations online, I wanted to adapt it on my case, but while testing the code I had a problem that I don't know how the fix.
  You'll find below my code :</p>
  
  <pre><code>import cv2
  import numpy as np
  
  img1 = cv2.imread("C:/Users/Akhou/Desktop/ALTRAN Tech.jpg")
  gray1= cv2.cvtColor(img1,cv2.COLOR_BGR2GRAY)
  img2 = cv2.imread("C:/Users/Akhou/Desktop/ALTRAN Tech.jpg")
  gray2= cv2.cvtColor(img2,cv2.COLOR_BGR2GRAY)
  
  sift1 = cv2.xfeatures2d.SIFT_create()
  kp1, des1 = sift1.detectAndCompute(gray1,None)
  
  sift2 = cv2.xfeatures2d.SIFT_create()
  kp2, des2 = sift2.detectAndCompute(gray2,None)
  
  featurlist=[]
  featurlist += [kp2, des2]
  bf = cv2.BFMatcher()
  matches1 = bf.knnMatch(des1,des2, k=2)
  good = []
  for m,n in matches1:
      if m.distance &lt; 0.7*n.distance:
          good.append([m])
          a=len(good)
          print(a)
          percent=(a*100)/kp2
          print("{} % similarity".format(percent))
          if percent &gt;= 75.00:
              print('Match Found')
              break;
  
  img3 = cv2.drawMatchesKnn(img1,kp1,img2,kp2,good,None,flags=2)
  </code></pre>
  
  <p>and this is error that I'm having :</p>
  
  <pre><code>percent=(a*100)/kp2
  TypeError: unsupported operand type(s) for /: 'int' and 'list'
  </code></pre>
  
  <p>Thank you for your time and help.</p>