kdtree for matlab
by
Andrea Tagliasacchi
22 Sep 2008
(Updated
01 Sep 2010)
A kdtree mex lib which allows for nearest neighbor, knearest neighbor, range and ball queries

kdtree_nearest_neighbor.m 
% KDTREE_NEAREST_NEIGHBOR query a kdtree for nearest neighbor
%
% SYNTAX
% idxs = kdtree_nearest_neighbor( tree, P )
%
% INPUT PARAMETERS
% tree: a pointer to the previously constructed kd tree
% P: a set of N kdimensional points stored in a
% NxK matrix (i.e. each row is a point). For each of these
% points a kdtree query is executed and the index
% of the closest point is stored in the nth position in the
% output
%
% OUTPUT PARAMETERS
% idxs: a column vector of scalars that index the point database.
% In kth position the index of the point in the database
% closest to P(k,:) can be found.
%
% See also:
% KDTREE_BUILD, KDTREE_NEAREST_NEIGHBOR_DEMO
%
%
% References:
% [1] M. De Berg, O. Cheong, and M. van Kreveld.
% Computational Geometry: Algorithms and
% Applications. Springer, 2008.
%
% Copyright (c) 2008 Andrea Tagliasacchi
% All Rights Reserved
% email: ata2@cs.sfu.ca
% $Revision: 1.0$ Created on: 2008/09/15


Contact us