Is there any way to fill this shape?

2 visualizaciones (últimos 30 días)
hanis nadhirah
hanis nadhirah el 14 de Nov. de 2019
Editada: hanis nadhirah el 14 de Nov. de 2019
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 comentarios
hanis nadhirah
hanis nadhirah el 14 de Nov. de 2019
Editada: hanis nadhirah el 14 de Nov. de 2019
@ Matt J , Done
Matt J
Matt J el 14 de Nov. de 2019
Editada: Matt J el 14 de Nov. de 2019
The .m file throws an error.

Iniciar sesión para comentar.

Respuesta aceptada

Matt J
Matt J el 14 de Nov. de 2019
Editada: Matt J el 14 de Nov. de 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 comentarios
Matt J
Matt J el 14 de Nov. de 2019
Editada: Matt J el 14 de Nov. de 2019
Get what? The channel images? They are the slices H(:,:,i).
hanis nadhirah
hanis nadhirah el 14 de Nov. de 2019
Thank you so much sir Matt J.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Modify Image Colors en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by