How to seperate the circle object from the background.

2 views (last 30 days)
This is the image sample that I want to separate the object(in this case is the medicine)

Answers (1)

Matt J
Matt J on 9 Nov 2022
Edited: Matt J on 9 Nov 2022
A=double(load('Image').A);
B=rgb2hsv(A);
C=bwareafilt(imbinarize(B(:,:,2)),1);
mask=imclose(C,strel('disk',15));
imshow(mask.*A/255,[])

Categories

Find more on Images in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!