I am reading through vl_ubcmatch’s function source code, provided here, and I am trying to understand, how does it compute the score, and how does it work technically internally.
However, this C code has these macros, weird ## variables like, and what not, that I don’t have experience with. So the main problem here is rather my incompetency in C. If possible, could somebody tell me, how does vl_ubcmatch work exactly? How does it compare two descriptors?
This is explained in Sections 7.1 and 7.2 of Distinctive Image Features
from Scale-Invariant Keypoints.
Documentation for the function is here: http://www.vlfeat.org/mdoc/VL_UBCMATCH.html
A match from feature d1 in image 1 to feature d2 in image 2 is used only if the distance between d1 and d2 is significantly smaller than the distance to d1 and any other feature in image 2. The match needs to be significantly better than any other potential match. “Significant” is defined by the threshold that you pass to the VL_UBCMATCH function.
Section 7.2 refers to an approximate nearest neighbor search structure, but VL_UBCMATCH doesn’t use this:
Here’s the pseudocode: