필터 지우기
필터 지우기

How to prevent Convexhull function data reduction in matlab ?

조회 수: 1 (최근 30일)
Ali Gh
Ali Gh 2018년 7월 11일
답변: Steven Lord 2018년 7월 11일
By default , convexhull function reduce the data given to it , How can we prevent it from doing it ? when this function do so , it will we useless for complicated shapes. Actually I need a Concave hull function. Thanks in advance.

답변 (1개)

Steven Lord
Steven Lord 2018년 7월 11일
Concave hulls are ambiguous, though there may be a tool that will help you that I'll mention after the example. Consider this set of points:
x = [-1 1 1 -1 0];
y = [-1 -1 1 1 0];
plot(x, y, 'o');
axis([-2 2 -2 2]);
axis square
Which would be the concave hull of this data?
figure
subplot(2, 2, 1);
plot(x([1:5 1]), y([1:5 1]), 'o-');
axis([-2 2 -2 2]);
axis square
subplot(2, 2, 2);
plot(x([1 2 5 3 4 1]), y([1 2 5 3 4 1]), 'o-');
axis([-2 2 -2 2]);
axis square
subplot(2, 2, 3);
plot(x([1 2 5 3 4 5 1]), y([1 2 5 3 4 5 1]), 'o-');
axis([-2 2 -2 2]);
axis square
subplot(2, 2, 4);
plot(x([1:4 1]), y([1:4 1]), 'o-');
hold on
plot(x(5), y(5), 'o');
axis([-2 2 -2 2]);
axis square
That being said, the alphaShape function may do what you want.
figure
plot(alphaShape(x.', y.'))
axis([-2 2 -2 2]);
axis square
Choose your alpha value carefully.

카테고리

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