Azzera filtri
Azzera filtri

How to create Boundary Recognition and Region Triangulation concurrently?

2 visualizzazioni (ultimi 30 giorni)
Hi guys. How can I fix my code to use Delaunay triangulation by applying alphaShape to just triangulate inside the letters? my code is triangulating the convex-hull of every letter.
Clearly, I want to make a triangulation for every letter by using Delaunay Triangulation and AlphaShape Functions. My m file and xls file are attached here.
My CODE:
close all
clear all
clc
P = xlsread('input.xlsx',1,'A1:B681');
shp = alphaShape(P);
nor = shp.numRegions;
for i = 1 : nor % i = RegionID
[trs{i}, pts{i}] = alphaTriangulation(shp,i);
end
for j = 1 : nor
DT = delaunayTriangulation(pts{1,j}); % DT = delaunayTriangulation(P,C)
IC = incenter(DT);
triplot(DT,'r');
axis ([-100 12000 -100 3500])
grid on
hold on
plot(IC(:,1),IC(:,2),'.r','MarkerSize',10)
hold on
plot(DT.Points(:,1),DT.Points(:,2),'.b','MarkerSize',20)
hold on
k = convexHull(DT);
xHull = DT.Points(k,1);
yHull = DT.Points(k,2);
% plot(xHull,yHull,'k','LineWidth',2)
end
  1 Commento
Ehsan Ben
Ehsan Ben il 15 Feb 2018
The "alphaShape" is doing right its duty. to check this, you can use "plot(shp)" in the last line of the CODE. The problem is, Delaunay Triangulation is making extra triangles on each letter that these extra triangles are very large in comparison to others.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Delaunay Triangulation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by