Border detection out of regular shape
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I have this shape in the plot, but I want to detect the 4 tails sticking out of the square in order to remove them. How could I detect them? I only have a single vector of points (x,y) which are in the plot. Attached is the variable containing the points.
Thanks!
댓글 수: 4
Les Beckham
2022년 4월 8일
If you attach your data as a mat file using the paperclip (either edit your question or add it in a comment), it will make it easier to help you.
채택된 답변
Matt J
2022년 4월 8일
편집: Matt J
2022년 4월 8일
load data_points
data0=data;
shp=alphaShape(data,0.9);
[~,V]=boundaryFacets(shp);
shp=polyshape(V,'Simplify',true);
for i=[-1,sqrt(2)]
shp=polybuffer(shp,i,'Joint','square');
end
tf=shp.isinterior(data);
data=data(tf,:);
plot(data0(:,1),data0(:,2),'o',data(:,1),data(:,2),'.r'); hold on
댓글 수: 3
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Bar Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!