KD Tree Nearest Neighbor and Range Search
by Steven Michael
01 Mar 2005
(Updated 01 Apr 2008)
KD Tree range and nearest neighbor search.
|
Watch this File
|
| File Information |
| Description |
This implements a KDTree for nearest neighbor and range searching.The KDTree stores a N-dimensional set of points. The tree can be queried for all points within a Euclidian range in order O(sqrt(p)+k) time, where p is the number of points and k is the number of reported points. A nearest neighbor search can be done in order O(log(p) time. The m-files are binary MATLAB functions written in C++. Source code is included as well as binaries for Linux on i386 and x86_64 systems and Windows (i386). |
| Acknowledgements |
This submission has inspired the following:
Efficient Kernel Smoothing Regression using KD-Tree, Kdtree implementation in matlab , Efficient K-Nearest Neighbor Search using JIT
|
| MATLAB release |
MATLAB 7.6 (R2008a)
|
| Other requirements |
Source included; binaries for Linux (i386,x86_64) & Windows (i386) are included |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (22) |
| 20 Apr 2005 |
Alaa Halawani
|
|
|
| 21 Apr 2005 |
João Ferreira
|
|
|
| 08 Jun 2005 |
T M
|
|
|
| 30 Aug 2005 |
hu wenchao
|
|
|
| 11 Nov 2005 |
Zach Buckner
|
|
|
| 31 Jan 2006 |
J. Knight
|
|
|
| 08 Jul 2006 |
Liu Shuyong
|
|
|
| 12 Aug 2007 |
Sam Dambreville
|
|
|
| 04 Nov 2007 |
saurabh agrawal
|
|
|
| 25 Mar 2008 |
Yi Cao
|
|
|
| 06 Jul 2008 |
David Doria
|
|
|
| 10 Jul 2008 |
David Doria
|
|
|
| 23 Jul 2008 |
Nils **********
|
|
|
| 01 Aug 2008 |
Kim A
|
|
|
| 21 Aug 2008 |
Paul Le
|
|
|
| 12 Sep 2008 |
Andrea Tagliasacchi
|
|
|
| 14 Jul 2009 |
xin chen
|
|
|
| 09 Sep 2009 |
sun jin
|
|
|
| 08 Apr 2010 |
aarif
|
|
|
| 24 May 2010 |
Erez
|
|
|
| 03 Nov 2010 |
Srikrishna
|
|
|
| 23 May 2011 |
kennyou
|
|
|
| Updates |
| 07 Apr 2005 |
A small but important change -- the border searching for the closest point function now compares |r|^2 instead of |r|. Removing the square root function siginificanly speeds up the closest point algorithm. |
| 20 Apr 2005 |
Fix memory leak in kdtree creation |
| 29 Jun 2005 |
Update such that the tree is serialized instead of stored in an abstract pointer. This means that the tree can be saved in a MATLAB file (or to disk) and loaded again quickly. Also, the implementation is now done using MATLAB classes. |
| 11 Nov 2005 |
Update so that kdtree_range searches can be done on multiple volumes with a single call. Also, the tree creation switches from using a quicksort to a heapsort -- seems to be a little faster. |
| 09 May 2006 |
1. Significantly speed up tree creation
2. Lower latency (removed tree "unserialization" for each function call)
3. fixed kdtree_closestpoint bug that returned incorrect points (but not indices) when querying closest point. |
| 11 May 2006 |
Fix an error that allocates too much memory when creating tree |
| 06 Jun 2006 |
Fix a memory error that sometimes causes incorrect results. |
| 01 Apr 2008 |
Update to compile with MATLAB R2008a. Change to makefile-based Visual Studio solution for windows. |
|
Contact us at files@mathworks.com