我的目标是使用图像作为查询来搜索图像库。我想使用 SURF 和定制的 NN 技术来匹配相关图像并显示该图像的前十个结果。
一旦我得到用于比较两个图像的 SURF NN 匹配代码,我应该如何修改该代码以搜索图像库并找出前十个最接近的图像匹配?
谢谢
Once I get the SURF NN matching code working for comparing two images, how should I go about modifying that code to search through the library of images and spit out the top ten nearest image matches?
Does this help: https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/cpp/matching_to_many_images.cpp ?
您可以计算图像的所有 SURF 特征,然后构建 kd-tree。对于 knn 搜索,您还可以使用在 opencv 中实现的基于 flann 的搜索。(它可以调整搜索时间\精度,所以它可以是快速的近似搜索)