| File Information |
| Description |
In this file you can find a simple but effective algorithm for NN Search which I megalomaniacly called the GLTree.
It has been designed for uniformly random data but works fine even on sparse ones. If point are too sparse, for example logspace data, search is still performed correctly but speed can degenerate to a brute serch algorithm. In these cases a different data structure is needed but for lack of time and C++ skill I havent' still coded. It only supports 2D points.
This new release includes:
-NNSearch
-KNNSearch
-RadiusSearch
Moreover diferrently from the last version now the tree can be build without running any search. The pointer passed to workspace can be used for the above routines.(Thanks to Andrea Tagliasacchi for his precious tips).
It is possible to choose if return the distances.
3D version wont be ready for a while.
Some of this functions are brand new so please advise me if any error occurs.
I AM LOOKING FOR C++ DEVELOPPERS WHO WANTS TO JOIN THE PROJECT TO ENLARGE AND MAKE MORE EFFICIENT THIS UTILTY. CONTACT ME IF YOU ARE INTERESTED.
I want to tell you that i am a C++ beginner, the code may look inefficient or childish to you, so if you have suggestions,
especially about the code metric, data structure or bottlenecks etc, it will be greatly appreciated.
Even things that may seem stupid to you wont seem to me.
Here is an example :
N=1000000;
%random reference and query points
px=rand(N,1);%reference
py=rand(N,1);
qpx=rand(N,1);%query
qpy=rand(N,1);
tic
ptrtree=BuildGLTree(px,py);
NNG=NNSearch(px,py,qx,qy,ptrtree);
toc
tic
NNG= annquery([px,py]',[qpx,qpy]', 1);
toc
Output:
1.46715 s
6.13951 s
If any problems occurs in execution, or if you found a bug, have a suggestion or question just contact me at:
giaccariluigi@msn.com |
| MATLAB release |
MATLAB 7.5 (R2007b)
|
| Other requirements |
Need a mex compiler |
| Zip File Content |
|
| Other Files |
GLTree020109/NNSearch.m, GLTree020109/NNSearch.cpp, GLTree020109/KNNSearch.m, GLTree020109/, GLTree020109/TestMexFiles.m, GLTree020109/KNNSearch.cpp, GLTree020109/GLTree.cpp, GLTree020109/RSearch.m, GLTree020109/RSearch.cpp, GLTree020109/BuildGLTree.m, GLTree020109/ReadMe.m, GLTree020109/BuildGLTree.cpp, GLTree020109/GLTree.h
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 29 Nov 2008 |
Fixed a little the demo file |
| 01 Dec 2008 |
Fixed help lines |
| 08 Dec 2008 |
Added Build Tree, NNSearch, RSearch, KSearch |
| 17 Dec 2008 |
Modified presentation |
| 02 Jan 2009 |
Fixed a bug on KNN, now it is possible to return the distances |
|