Effacer les filtres
Effacer les filtres

How can I reset the h and s channels?

1 vue (au cours des 30 derniers jours)
matlab9000
matlab9000 le 24 Mar 2018
Commenté : matlab9000 le 27 Mar 2018
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?

Réponse acceptée

Walter Roberson
Walter Roberson le 24 Mar 2018
NewImage = hsvimage;
NewImage(:, :, 1:2) = 0;
However if your purpose is to desaturate then you should only assign to the s channel, 2
  3 commentaires
Walter Roberson
Walter Roberson le 27 Mar 2018
You forgot to convert back to rgb before displaying.
matlab9000
matlab9000 le 27 Mar 2018
Thanks !!!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by