简体   繁体   中英

Delaunay triangulation : Matlab

I was trying to write a code using Delaunay triangulation method and I got a plot with some bunch of triangles. But how can I verify whether what I plotted is correct or not? or whether the triangles are from the desired points or not?

 I = bwmorph(I,'skel',Inf);
[i1,j1] = ind2sub(size(I),find(bwmorph(bwmorph(I,'thin',Inf),'branchpoint') == 1));
tri1 = delaunayTriangulation(i1,j1)
figure
triplot(tri1)

This is a part of my code where DT was implemented.

Input 在此处输入图片说明

DT

在此处输入图片说明

To have a visual check you can simply overlay the result of the Delaunay triangulation onto your points with hold on . For instance:

figure
hold on
scatter(i1,j1, 'r');
triplot(tri1)

Best,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM