Which and where are each of HSI component image(Hue component,Intensity component,saturation component)
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
ABTJ
le 14 Mai 2020
Commenté : Subhadeep Koley
le 27 Mai 2020
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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/293036/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/293037/image.jpeg)
0 commentaires
Réponse acceptée
Subhadeep Koley
le 25 Mai 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 commentaires
Subhadeep Koley
le 27 Mai 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);
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Visual Exploration dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!