H,S,V components
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Aysel Alimirzayeva
le 7 Nov 2022
Commenté : Aysel Alimirzayeva
le 8 Nov 2022
Hello.How can I display the H,S,V components separately in matlab on the example below?Please,canyou help me?
0 commentaires
Réponse acceptée
Maik
le 7 Nov 2022
Modifié(e) : Maik
le 7 Nov 2022
Im = imread('peppers.png');
% Display RGB image
figure;imshow(Im);
% Convert RGB to HSV
hsvIm = rgb2hsv(Im);
% Display HSV channels
hChannel = hsvIm(:,:,1);
figure;imshow(hChannel);
sChannel = hsvIm(:,:,2);
figure;imshow(sChannel);
vChannel = hsvIm(:,:,3);
figure;imshow(vChannel);
3 commentaires
Plus de réponses (2)
John D'Errico
le 7 Nov 2022
trivial, really.
help rgb2hsv
So simply convert to HSV. Then you can use a tool like imshow
waves = imread('waves.jpg');
waves_HSV = rgb2hsv(waves);
imshow(waves_HSV(:,:,1))
title 'H channel'
imshow(waves_HSV(:,:,2))
title 'S channel'
imshow(waves_HSV(:,:,3))
title 'V channel'
Easy peasy.
Voir également
Catégories
En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!