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 CenterFile Exchange에서 Bounding Regions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by