How can I get the vertices of each polygon of a Voronoi diagram?

조회 수: 14 (최근 30일)
Eman S
Eman S 2018년 7월 12일
댓글: Rena Berman 2020년 5월 14일
Hi all, For the following image;
How can I get the vertices (which are highlighted by orange dots) of each Voronoi polygon of the following Voronoi diagram?
The picture is from the Internet. It is just for illustration.
Any suggestions for code to get these vertices?
  댓글 수: 2
KSSV
KSSV 2018년 7월 13일
How you got this image? YOu plotted using inbuilt function? Or you have a image and you want to get points from the image?
Rena Berman
Rena Berman 2020년 5월 14일
(Answers Dev) Restored edit

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2018년 7월 20일
x = gallery('uniformdata',[1 10],0);
y = gallery('uniformdata',[1 10],1);
[vx,vy] = voronoi(x,y);
plot(x,y,'r+',vx,vy,'b-')
axis equal
(vx,vy) are the vertices you want.
  댓글 수: 1
Karishma q
Karishma q 2019년 5월 14일
How do I get the co-ordinates of each polygon separately? I tried adding a for loop which defines the number of regions, but I am still getting the vertices of the last region. Also [vx, vy]=voronoi(x,y) provides all the coordinates, I want for the individual regions. Can you help me on this?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Voronoi Diagram에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by