How to determine the Voronoi center coordinates knowing ?
조회 수: 9 (최근 30일)
이전 댓글 표시
I have a skeleton of a road network and i want to estimate the cùenter of eacùh cell of the voronoi diagram
below the image
any ideas please !
thx
댓글 수: 2
Sean de Wolski
2014년 6월 17일
So you want to calculate the voronoi diagram of the end points and then find the centers? I'm not totally clear on how you want to get from the above image to your centroids.
답변 (1개)
Jason Nicholson
2014년 6월 18일
편집: Jason Nicholson
2014년 6월 18일
This does not deal with the inf's. You will have to replace the infinities with finite values on your boundary to get a better center estimation.
X = rand(10,2);
[V,C] = voronoin(X);
xCenter = cellfun(@(index) mean(V(index,1)),C);
yCenter = cellfun(@(index) mean(V(index,2)),C);
참고 항목
카테고리
Help Center 및 File Exchange에서 Voronoi Diagram에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!