Ask Your Question
0

why do we always intersted in the rows of the descriptor of the query when it comes to drawing the matches

asked 2015-04-09 09:31:25 -0600

RB gravatar image

updated 2015-04-10 09:20:09 -0600

berak gravatar image

i have taken a look at some of the posts in this site and others as well, an i notices that, after callin the .match(..,...,..,) method, and to draw correct matches we always use the queryDescriptor.rows() as shown in the bellow snippet, i found it here

  //calc min/max dist
Double max_dist = 0.0;
Double min_dist = 100.0;
for(int i = 0; i < descriptor_object.rows(); i++){
    Double dist = (double) matchesList.get(i).distance;
    if(dist < min_dist) min_dist = dist;
    if(dist > max_dist) max_dist = dist;
}

1-why always the querydescriptors' rows? and why the queryDescriptor??

2-if i took the matches from the .match(..,..,..) method, and convert them to DMatch object, and then sorted them ascendingly with respect to the distance attribute, at this case, do i need thresholding?? i am asking this question because, since i have an ascending sorted list, then i can just pick the top 10, 30 or whatever i want, so do i still need thresholding?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2015-04-10 04:57:38 -0600

Eduardo gravatar image

updated 2015-04-10 05:00:35 -0600

To complete the answer of thdrksdfthmn :

  1. rows is the number of query keypoints, cols is the size of the descriptors (depends on the type of the descriptor, for SIFT it is 128, for SURF it is 128, for U-SURF it is 64). So each row in queryDescriptors contain the values corresponding to the descriptor of one query keypoints. The method "match" find for each query keypoint the closest train keypoint. If you have 10 query keypoints and 20 train keypoints, you will have 10 matches (of course if you match query to train keypoints).
  2. You can sort yourself the list of DMatch by distance and pick only the 10 first matches. But, by doing that, if the two images are completly different you will certainly have 10 false matches.

You should also take a look at this paper to see the difference between each matching strategie: A performance evaluation of local descriptors.

edit flag offensive delete link more
2

answered 2015-04-10 03:55:47 -0600

thdrksdfthmn gravatar image
  1. The descriptor has 32 or 64 or 128 values, depending on its type. So one descriptor is a vector of 32, 64 or 128 values. Storing it in a Mat, you'll have a Mat with one row and 32, 64 or 128 colums. The queryDescriptor object is a Mat that contains more descriptors (stored on rows), so every time you want to compute a match, that is computing the distance between the two descriptors. This is why you always do matching on rows.

  2. And about the match method that returns a sorted list... I do not think so. In the docs they are saying not so.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-04-09 09:31:25 -0600

Seen: 164 times

Last updated: Apr 10 '15