how to find the smallest object in the coin image?
조회 수: 3 (최근 30일)
이전 댓글 표시
how to find the smallest object in the image below ? the code I wrote below does not work
A = imread('eight.tif');
C=imbinarize(A, 'adaptive', 'ForegroundPolarity', 'dark');
figure,imshow(C)
BW3=bwareafilt(C,1,'smallest');
figure, imshow(BW3)
댓글 수: 0
채택된 답변
Matt J
2022년 1월 1일
편집: Matt J
2022년 1월 1일
This should make it easier:
A = imread('eight.tif');
C=imbinarize(A, 'adaptive', 'ForegroundPolarity', 'dark');
C=bwareafilt( bwconvhull(~C,'objects') ,4);
figure,imshow(C)
댓글 수: 4
Matt J
2022년 1월 1일
okay, well if you think the problem is solved, then please Accept-click the answer to indicate so.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!