How can I reset the h and s channels?

2 ビュー (過去 30 日間)
matlab9000
matlab9000 2018 年 3 月 24 日
コメント済み: matlab9000 2018 年 3 月 27 日
I have an image in hsv and I would like to set the h and s channels to 0 in order to have the desaturated image. How can I do?

採用された回答

Walter Roberson
Walter Roberson 2018 年 3 月 24 日
NewImage = hsvimage;
NewImage(:, :, 1:2) = 0;
However if your purpose is to desaturate then you should only assign to the s channel, 2
  3 件のコメント
Walter Roberson
Walter Roberson 2018 年 3 月 27 日
You forgot to convert back to rgb before displaying.
matlab9000
matlab9000 2018 年 3 月 27 日
Thanks !!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by