How to remove everything that is grey (127, 127, 127) from an image?
3 次查看(过去 30 天)
显示 更早的评论
Hi,
I want to remove everything with the rgb color (127, 127, 127) from an image. I am using
externalMask = planta.img(:,:,1)==127 & planta.img(:,:,2)==127 &...
planta.img(:,:,3)==127
to know where the grey pixels are.
I want to show the image and that the grey parts doesn't appear.
How can I do that?
Thanks in advance!
PS: I am using R2016a version.
0 个评论
采纳的回答
Walter Roberson
2020-12-29
编辑:Walter Roberson
2020-12-29
mask = all(planta.img == 127, 3);
image(planta.img, 'AlphaData', 1-mask)
5 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!