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

25 次查看(过去 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