フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I cannot remove objects that do not fit the metric from the tagged image, how can I remove them?

1 回表示 (過去 30 日間)
Merve YILDIRIM
Merve YILDIRIM 2020 年 6 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
%%
[B,L] = bwboundaries(BM,'noholes'); %BM is image(2717x1985 double)
imshow(label2rgb(L,@jet,[.5 .5 .5]))
hold on
%%
for k = 1:length(B)
boundary = B{k};
plot(boundary(:,2),boundary(:,1),'w','LineWidth',2)
end
%%
stats = regionprops(L,'Centroid','Eccentricity','MajorAxisLength','MinorAxisLength','Area');
t=0.85;
for k=1:length(B)
boundary = B{k};
Eccentricity=stats(k).Eccentricity;
metric=Eccentricity;
metric_string = sprintf('%2.3f',metric);
if metric <= t;
centroid = stats(k).Centroid;
plot(centroid(1),centroid(2),'k*');
%metriği sağlamayan objelerin silinmesi
else;
L(L==k) = 0;
end;
end;

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by