how do I find the smallest object in a binary coins image ?

2 Ansichten (letzte 30 Tage)
betty
betty am 7 Dez. 2021
Kommentiert: betty am 8 Dez. 2021
How to find the smallest object in the image below I would appreciate it if you could help

Antworten (2)

Yusuf Suer Erdem
Yusuf Suer Erdem am 7 Dez. 2021
check imfindcircles command. there are multiple similar examples on matlab help center. try to adapt yours to them.

yanqi liu
yanqi liu am 8 Dez. 2021
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)

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by