近邻搜索算法

最近邻搜索(Nearest Neighbor Search)

Name of the problem: nearest neighbors, k nearest neighbors (kNN, k-NN), nearset neighbor search, proximity search, similarity search, approximate nearest neighbors (ANN), range queries, maximal intersection queries, post-office problem, partial match, best match file searching, best match retrieval, sequence nearest neighbors (SNN). 

Solution concepts: locality-sensitive hashing (LSH), low-distortion embeddings, k-d trees, kd-trees, metric trees, M-trees, R*-trees, vp-trees, vantage point trees, vantage point forest, multi-vantage point tree, bisector trees, Orchard's algorithm, random projections, fixed queries tree, Voronoi tree, BBD-tree, min-wise independent permutations, Burkhard-Keller tree, generalized hyperplane tree, geometric near-neighbor access tree (GNAT), approximating eliminating search algorithm (AESA), inverted index, spatial approximation tree (SAT). 

Applications: k-nearest neighbor classification algorithm, image similarity identification, audio similarity identification, fingerprint search, audio/video compression (MPEG), optical character recognition, coding theory, function approximation, recommendation systems, near-duplicate detection, targeting on-line ads, distributional similarity computation, spelling correction, nearest neighbor interpolation. 

常见的近邻搜索库包括ANN,FLNN,当然八叉树也可以实现近邻搜索。也可以通过狄洛尼三角网实现近邻的判断。

1.K近邻搜索、近似近邻搜索

2.k-d树

3.R树

 对应点的matlab显示

fileID = fopen('data2\correspondence_1.txt');
C =textscan(fileID,'%f%f%f%f%f%f%d%d%f') ;
modelx=C{1};
modely=C{2};
modelz=C{3};
datax=C{4};
datay=C{5};
dataz=C{6};
distance=C{9};
%误差向量
vectorx=modelx-datax;
vectory=modely-datay;
vectorz=modelz-dataz;
figure(1);
hold on
    plot3(modelx,modely,modelz, 'r+');
    plot3(datax,datay,dataz, 'b+');

    %% 连线
    for i = 1:size(modelx,1)
        plot3([modelx(i) datax(i)], [modely(i) datay(i)], [modelz(i) dataz(i)], 'g--')
    end
    axis equal
hold off
figure(2);
hold on
    hist(distance,100);
hold off

参考文献:

1. http://www.cnblogs.com/breakinen/archive/2012/03/31/bigdata_nearest_neighbor_search.html?utm_source=tuicool&utm_medium=referral

2. http://www.cnblogs.com/v-July-v/archive/2012/11/20/3125419.html

3. http://blog.sina.com.cn/s/blog_72e1c7550101dsc3.html

https://en.wikipedia.org/wiki/Nearest_neighbor_search#Approximate_nearest_neighbor

原文地址:https://www.cnblogs.com/yhlx125/p/5251771.html