Which and where are each of HSI component image(Hue component,Intensity component,saturation component)
23 ビュー (過去 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)
0 件のコメント
採用された回答
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 件のコメント
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 Center および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!