Information about NearestNeighbor function

I need to learn the algorithm behind the MatLab NN functions (on delauney triangulations). I need to program this in java so I would like any help pointing to an algorithm or a library.
Possibly a solution different than CGAL java bindings.
any help is greatly appreciated.

回答 (1 件)

José-Luis
José-Luis 2013 年 5 月 28 日

0 投票

As far as I understand, Matlab uses qhull for delaunay triangulations. Is there a particular reason you want to use the qhull algorithm? The source code is freely available, but it's written in C++. Beware that it's not an insignificant amount of code and rewriting it all in Java is an ambitious project.
You are probably better off using JNI, but even that might require quite some work. I would advise not to try reinventing the wheel, unless you have compelling reasons to do so.
If you want to know what other algorithms can be used, then I would recommend looking at any computational geometry book.

2 件のコメント

Rasael
Rasael 2013 年 5 月 29 日
編集済み: Rasael 2013 年 5 月 29 日
Thank you for your answer.
I already have made the triangulation myself (since I am triangulating an image there is no need of delauney).
I am in need of learning how the nearest neighbor function works on a delauney triangulation class (point to triangular surface). Specifically, an optimized algorithm.
José-Luis
José-Luis 2013 年 5 月 29 日
I don't understand. If you don't have a Delaunay triangulation, how do you expect to get the nearest neighbors (in the euclidean sense) from it? The closest points would then not be guaranteed to be connected by edges.
Finding the closest points, given a Delaunay triangulation would amount to an iterative search of the connected points, calculating the euclidean distances for each iteration. If you are interested in a larger number of points, it might be more efficient to calculate all the euclidean distances between the point you are interested in and the rest from the get go.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeDelaunay Triangulation についてさらに検索

質問済み:

2013 年 5 月 28 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by