Assuming you have this drawline function that draws lines in images, this is how you loop over the edges of Voronoi diagram of a set of points:%# set of points and voronoi diagramX = rand(10,1)*200; Y = rand(10,1)*200;[vx,vy] = voronoi(X,Y);%# vertices connecting the edgesp1 = [vx(1,:);vy(1,:)]; % columns are "from" pointsp2 = [vx(2,:);vy(2,:)]; % columns are "to" points%# draw edges on top of image matriximg = zeros(200,200,3);clr = [255 0 0];for i=1:size(vx,2) img = drawline(p1(:,i), p2(:,i), clr, img);end 这篇关于Matlab:如何在voronoi图中导出多边形的顶点(坐标)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-15 01:48