フィルターのクリア

How to create Boundary Recognition and Region Triangulation concurrently?

2 ビュー (過去 30 日間)
Ehsan Ben
Ehsan Ben 2018 年 2 月 15 日
コメント済み: Ehsan Ben 2018 年 2 月 15 日
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 件のコメント
Ehsan Ben
Ehsan Ben 2018 年 2 月 15 日
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.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDelaunay Triangulation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by