# to get the coordinates of matched features ?

I'm working on ubuntu-16 and python 2.7 opencv 3. I want to extract the (x,y)coordinates of the matched keypoints of two iamges. i could get the features plotted but i could not exract the points . i would be really helpful if you can check the code and help me add if anything needed.

import numpy as np
import cv2
from matplotlib import pyplot as plt

# Initiate SIFT detector
sift = cv2.xfeatures2d.SIFT_create()

# find the keypoints and descriptors with SIFT
kp1, des1 = sift.detectAndCompute(img1,None)
kp2, des2 = sift.detectAndCompute(img2,None)

# FLANN parameters
FLANN_INDEX_KDTREE = 0
index_params = dict(algorithm = FLANN_INDEX_KDTREE, trees = 5)
search_params = dict(checks=50)   # or pass empty dictionary

flann = cv2.FlannBasedMatcher(index_params,search_params)

matches = flann.knnMatch(des1,des2,k=2)

# Need to draw only good matches, so create a mask
matchesMask = [[0,0] for i in xrange(len(matches))]

# ratio test as per Lowe's paper
for i,(m,n) in enumerate(matches):
if m.distance < 0.7*n.distance:

draw_params = dict(matchColor = (0,255,0),
singlePointColor = (255,0,0),