I'm working on a FLANN based Matcher using OpenCV, and for specific reasons, I need to get access to each pair coordinates of matches object (DMatch). The result of good matches filter was stored in a nested list: i.e good_matches = [].
Once I tried to access the first object ( print good_matches[0] ) I got a memory pointer as a result: i.e. .
Any clues how the structure of this object looks like in python and how to access it?
ratio_thresh = 0.70
good_matches = []
for m,n in knn_matches:
if m.distance < ratio_thresh * n.distance:
good_matches.append(m)
print good_matches[0]
Let's say that the coordinates of the key points of each image are: (u_1,v_1) and (u_2,v_2). So I can access to each matched pair coordinates and compute them somehow later on.
See my answer to this question: How to get the positions of the matched points with Brute-Force Matching / SIFT Descriptors
To make long story short, the keypoints are not stored in DMatch, but in the other list. DMatch object only stores the indices of matched keypoints, their distance and the index of the image. You can get this indices to get the keypoints from the other list.