H,S,V components
조회 수: 18 (최근 30일)
이전 댓글 표시
Hello.How can I display the H,S,V components separately in matlab on the example below?Please,canyou help me?
댓글 수: 0
채택된 답변
Maik
2022년 11월 7일
편집: Maik
2022년 11월 7일
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
추가 답변 (2개)
John D'Errico
2022년 11월 7일
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.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!