近鄰搜索算法


最近鄰搜索(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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM