Is there any way to fill this shape?
2 views (last 30 days)
Show older comments
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
Accepted Answer
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');
5 Comments
More Answers (0)
See Also
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!