フィルターのクリア

Border detection out of regular shape

2 ビュー (過去 30 日間)
Albert
Albert 2022 年 4 月 8 日
コメント済み: Albert 2022 年 4 月 11 日
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
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.
Albert
Albert 2022 年 4 月 8 日
I have attached the mat file!

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

採用された回答

Matt J
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);
Warning: Polyshape has duplicate vertices, intersections, or other inconsistencies that may produce inaccurate or unexpected results. Input data has been modified to create a well-defined polyshape.
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 件のコメント
Matt J
Matt J 2022 年 4 月 8 日
Yes, or you could use isinterior() as in my now modified solution.
Albert
Albert 2022 年 4 月 11 日
thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by