Is there any way to fill this shape?

2 views (last 30 days)
I have try imfill but the shape still like that , upper one is circle and beside that is triangle. Thank you
Please do not copy the codes. Thank you.
  4 Comments
hanis nadhirah
hanis nadhirah on 14 Nov 2019
Edited: hanis nadhirah on 14 Nov 2019
@ Matt J , Done
Matt J
Matt J on 14 Nov 2019
Edited: Matt J on 14 Nov 2019
The .m file throws an error.

Sign in to comment.

Accepted Answer

Matt J
Matt J on 14 Nov 2019
Edited: Matt J on 14 Nov 2019
I=imread('shapes.jpg'); % to extract orange color
A=(I(:,:,1) >= 245 ) & (I(:,:,1) <= 255) & ...
(I(:,:,2) >= 121 ) & (I(:,:,2) <= 161) & ...
(I(:,:,3) >= 0 ) & (I(:,:,3) <= 13);
H=rgb2hsv(I);
B=H(:,:,1)<=0.12 & H(:,:,2)>=0.97 & H(:,:,3)>=0.97;
B=imfill(A|B,'holes');
untitled.png
  5 Comments
Matt J
Matt J on 14 Nov 2019
Edited: Matt J on 14 Nov 2019
Get what? The channel images? They are the slices H(:,:,i).
hanis nadhirah
hanis nadhirah on 14 Nov 2019
Thank you so much sir Matt J.

Sign in to comment.

More Answers (0)

Categories

Find more on Modify Image Colors in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!