What units is the 'distance' measured in? (in the matches of a SURF)

asked 2015-02-09 08:51:15 -0600

Potato gravatar image

I have been looking at feature detection and matching using the SURF and BFMatcher methods. In order to draw these matches, the maximum and minimum distances are calculated to help find 'good matches'

My question is, what unit is the distance calculated in? (cm, mm, inches).

This distance is the distance between two matched points. Is my understanding correct?

Thank you.

edit retag flag offensive close merge delete

Comments

no, it's not the distance between the points, but the one between the corresponding feature vectors, aka norm(f1,f2,NORM_L2)

berak gravatar imageberak ( 2015-02-09 08:55:03 -0600 )edit

So a 'larger distance' would represent a longer distance between two matched points and vice versa?

Potato gravatar imagePotato ( 2015-02-09 09:09:39 -0600 )edit
2

again, no. it's the similarity of the feature vectors, not the distance between matched points

see, that's the whole trick of the feature-matching: you don't know, if the (other) image was rotated/scaled/translated, so you can't compare the point locations.

what you can compare, is the features at the found keypoints. if you find a similar one in the other set, you can estimate, that this is the corresponding keypoint.

berak gravatar imageberak ( 2015-02-09 09:20:21 -0600 )edit

yes, I think it is in cm, too ... A 'larger distance' would represent that the two features are not similar, maybe you can start by understanding features and descriptors ;)

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-02-09 09:25:14 -0600 )edit
1

no, nothing is ever measured in cm here.

the point distances are in pixels, the feature distances might be bits (for the binary ones, like orb and brief), or 'histogram bins' for surf/sift

berak gravatar imageberak ( 2015-02-09 09:33:02 -0600 )edit

the cm was a joke, sorry about that. :)

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-02-09 09:37:47 -0600 )edit

^^ oh, sorry, that i did not get it ;)

berak gravatar imageberak ( 2015-02-09 09:44:31 -0600 )edit

That makes a lot more sense than what I was assuming it to be. Just to make sure I have understood. A 'shorter distance', would be a better match than a 'larger distance'?

Potato gravatar imagePotato ( 2015-02-09 09:52:10 -0600 )edit

So can we say that the distance is the magnitude of difference between the descriptors?

Potato gravatar imagePotato ( 2015-02-09 10:00:33 -0600 )edit

yes, shorter distance == better match.

what do you mean by 'magnitude' ?

berak gravatar imageberak ( 2015-02-09 10:08:21 -0600 )edit

By magnitude I meant that by higher the distance, the less accurate is the match.

So in trying to find a picture of say a chair, in a larger picture, it would be better to use only those matches with lesser distances, for a more accurate match?

Potato gravatar imagePotato ( 2015-02-09 10:12:02 -0600 )edit
2

ok, a feature is described by descriptors that is some kind a vector in a multidimensional space (32d or 128d...) and the matching is computing the distance between 2 vectors (that is why it is called distance), so the smaller the distance, the closer the vector are, so the better the matching is, hope it is clearer...

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-02-09 10:13:56 -0600 )edit

That is perfect. Thank you berak and thdrksdfthmn for your help. It has made this concept clearer to me.

Potato gravatar imagePotato ( 2015-02-09 10:16:07 -0600 )edit

What is the matches ? What is a diference between matches and keypoints ?

Thank you.

Diego Moreira gravatar imageDiego Moreira ( 2015-02-09 17:04:49 -0600 )edit