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

23 views (last 30 days)
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)

Accepted Answer

Subhadeep Koley
Subhadeep Koley on 25 May 2020
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 Comments
ABTJ
ABTJ on 26 May 2020
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 on 27 May 2020
@ 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);

Sign in to comment.

More Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!