how do I find the smallest object in a binary coins image ?
조회 수: 2 (최근 30일)
이전 댓글 표시
How to find the smallest object in the image below I would appreciate it if you could help
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/826480/image.png)
댓글 수: 0
답변 (2개)
Yusuf Suer Erdem
2021년 12월 7일
check imfindcircles command. there are multiple similar examples on matlab help center. try to adapt yours to them.
댓글 수: 0
yanqi liu
2021년 12월 8일
clc; clear all; close all;
im=imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/826480/image.png');
bw=im2bw(im);
bw=imclearborder(imfill(bw,'holes'));
% find the smallest object
stats=regionprops(bw);
ar=cat(1,stats.Area);
[~,ind]=min(ar);
figure; imshow(im);
hold on; rectangle('position', stats(ind).BoundingBox, 'EdgeColor', 'g', 'LineWidth', 2)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!