Efficient way for SIFT descriptor matching

前端 未结 3 1276
甜味超标
甜味超标 2021-02-09 14:18

There are 2 images A and B. I extract the keypoints (a[i] and b[i]) from them.
I wonder how can I determine the matching between a[i] and b[j], efficiently?

The ob

3条回答
  •  粉色の甜心
    2021-02-09 14:48

    KD tree stores the trained descriptors in a way that it is really faster to find the most similar descriptor when performing the matching.

    With OpenCV it is really easy to use kd-tree, I will give you an example for the flann matcher:

    flann::GenericIndex< cvflann::L2 >  *tree; // the flann searching tree
    tree = new flann::GenericIndex< cvflann::L2 >(descriptors, cvflann::KDTreeIndexParams(4)); // a 4 k-d tree
    

    Then, when you do the matching:

    const cvflann::SearchParams params(32);
    tree.knnSearch(queryDescriptors, indices, dists, 2, cvflann::SearchParams(8));
    

提交回复
热议问题