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

12 Ansichten (letzte 30 Tage)
Eman S
Eman S am 12 Jul. 2018
Kommentiert: Rena Berman am 14 Mai 2020
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 Kommentare
KSSV
KSSV am 13 Jul. 2018
How you got this image? YOu plotted using inbuilt function? Or you have a image and you want to get points from the image?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

KSSV
KSSV am 20 Jul. 2018
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 Kommentar
Karishma q
Karishma q am 14 Mai 2019
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?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Voronoi Diagram finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by