How to remove everything that is grey (127, 127, 127) from an image?

3 ビュー (過去 30 日間)
Oliver Lestrange
Oliver Lestrange 2020 年 12 月 29 日
コメント済み: Walter Roberson 2020 年 12 月 29 日
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.

採用された回答

Walter Roberson
Walter Roberson 2020 年 12 月 29 日
編集済み: Walter Roberson 2020 年 12 月 29 日
mask = all(planta.img == 127, 3);
image(planta.img, 'AlphaData', 1-mask)
  5 件のコメント
Image Analyst
Image Analyst 2020 年 12 月 29 日
Need double equals:
mask = all(planta.img == 127, 3);
Walter Roberson
Walter Roberson 2020 年 12 月 29 日
Good point

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by