# DMatch matches output

Hey,

I'm having some trouble trying to make sense out of the ouput of my matches. I print on screen both the query and train index and their respective distance, then I calculate the min and max distance. My logic tells me that if I'm comparing two different pictures of the same object, the min distance obtained should be smaller than the min distance obtained when matching two pictures of a different object, but that's not the case. Am I reading the output wrong? This is causing a lot of headaches, since I'm currently comparing two pictures and returning a matching rate percentage, but some of these rates are quite wrong.

Here's the DMatch output:

Query Index: 0; Train Index: 37; Distance: 113.0
Query Index: 1; Train Index: 79; Distance: 127.0
Query Index: 2; Train Index: 103; Distance: 136.0
Query Index: 3; Train Index: 103; Distance: 141.0
Query Index: 4; Train Index: 67; Distance: 117.0
Query Index: 5; Train Index: 33; Distance: 117.0
Query Index: 6; Train Index: 70; Distance: 102.0
Query Index: 7; Train Index: 168; Distance: 125.0
Query Index: 8; Train Index: 79; Distance: 68.0
Query Index: 9; Train Index: 101; Distance: 111.0
Query Index: 10; Train Index: 106; Distance: 93.0
Query Index: 11; Train Index: 69; Distance: 56.0
Query Index: 12; Train Index: 112; Distance: 102.0
Query Index: 13; Train Index: 66; Distance: 87.0
Query Index: 14; Train Index: 45; Distance: 104.0
[...]
Min Distance: 39.0
Max Distance: 155.0

How can I use this to determine the good matches? And why do the descriptors in orb return double if it's supposed to be a binary string?

Cheers

EDIT:

So after a few more tests, I've figured that those distances returned can only be the Hamming distance between the two given keypoints in query and train index. I've managed to apply some custom filters for my good matches, and the results are pretty good. If you need help with this, PM me. Cheers

edit retag close merge delete

I can't seem to send a PM so I'm asking here, would you mind explaining the distances to me? I applied a basic distance filter but the matches are still useless. I would really appreciate it if you could give me info about your custom filters. Thanks.

( 2012-11-15 07:43:55 -0600 )edit

Hi Alicia. So sorry for only replying now, but completely forgot this post. Anyway, custom filters are done by using the keypoint information, such as the angle, (x,y) coordinates and such. One filter we use , for instance, was dividing the image in N parts and comparing only the keypoints inside each part. Again, sorry for the delay in the answer and I hope it was still helpful! :)

( 2013-04-11 05:39:01 -0600 )edit