Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
I cannot remove objects that do not fit the metric from the tagged image, how can I remove them?
조회 수: 1 (최근 30일)
이전 댓글 표시
%%
[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
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!