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 Exchange에서 Delaunay 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