I have a created function file in hand which is to draw lines in image,[img]=drawline(point1,point2,color,img)
. It's used to connect any two points that are inside the image. I'm asked to create the voronoi diagram in image (not using plot function). For the moment, i'm trying to show the lines in image, but i don't know how to get the vertices of the polygon edges.
I've been using some test codes:
x=[50 70 70 30 40 ];% this is just some simple values for testing,
y=[50 30 90 30 80 ];% in further stage, i plan to use `x=rand(n,1)*200`.
img=zeros(200,200,3);
color=[255 0 0];
[vx,vy]=voronoi(x,y);
I only know till above, next i think i need to use for loop
to line the vertices up. just no idea how to start.And i'm also stuck in how to solve the negative and infinite issues, if i need to display them in image(pixels coordinates).