Which and where are each of HSI component image(Hue component,Intensity component,saturation component)

조회 수: 1 (최근 30일)
The attached article talks about hue,saturation and intensity images. Where is each of them in fig6.25 ? I know that fig(b) shows Hue image but where are other two(saturation and intensity images)

채택된 답변

Subhadeep Koley
Subhadeep Koley 2020년 5월 25일
The image which you attached does not depict the saturation and intensity images. However, you can create that test image and segregate the H, S and V component. Refer the code below,
clc; close all;
testImg = zeros(200, 200, 3);
% Generate red portion
testImg(1:100, 101:200, 1) = 1;
% Generate green portions
testImg(1:100, 1:100, 2) = 1;
testImg(101:200, 101:200, 2) = 1;
% Generate blue portion
testImg(101:200, 1:100, 3) = 1;
% Convert from RGB to HSV
hsvTestImg = rgb2hsv(testImg);
% Segregate hue, sat, and value/intensity
hueTestImg = hsvTestImg(:, :, 1);
satTestImg = hsvTestImg(:, :, 2);
valTestImg = hsvTestImg(:, :, 3);
% Display the RGB and the corresponding HSV components
figure; subplot(2, 2, 1)
imshow(testImg); title('RGB test image');
subplot(2, 2, 2)
imshow(hueTestImg); title('Hue component');
subplot(2, 2, 3)
imshow(satTestImg); title('Saturation component');
subplot(2, 2, 4)
imshow(valTestImg); title('Value/intensity component');
You will see that for this particular test image, the Saturation and the Intensity componets are flat white images(all values are one). The saturation image contains all one values because, the testImg contains maximum saturated pure R, G, and B colors and 1 indicates maximum saturation. On the other hand, the intensity image contains all one values as, the intensity image shows the maximum value among the red, green, and blue components of a specific color.
  댓글 수: 2
ABTJ
ABTJ 2020년 5월 26일
Please kindly explain a bit, how you are using testImg expression? Especially how you are adjusting/setting input arguments to achieve different colors red,green and blue
Subhadeep Koley
Subhadeep Koley 2020년 5월 27일
@ ABTJ First of all the testImg is a 3D array containing all zero values. Setting first channel of a 3D array to 1, I am creating the red color. Similarly we can create green and blue also by setting the second, and the third channel of the 3D array to 1. Execute the below code line by line, it will be clarified.
testImg = zeros(200, 200, 3);
figure; imshow(testImg);
% Generate red portion
testImg(1:100, 101:200, 1) = 1;
figure; imshow(testImg);
% Generate green portions
testImg(1:100, 1:100, 2) = 1;
figure; imshow(testImg);
testImg(101:200, 101:200, 2) = 1;
figure; imshow(testImg);
% Generate blue portion
testImg(101:200, 1:100, 3) = 1;
figure; imshow(testImg);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by