Convert RGB to HSI
Show older comments
I am looking for the values in the first row of S of an HSI color model. Unfortunately, I do not get the desired values. I assume it is my conversion from rgb to hsi. Instead I use rgb2hsv. Does this make any difference?
R = [ 120 20 30;
170 20 70;
120 140 70 ]
G = [ 40 150 20;
20 110 20;
25 20 20 ]
B = [20 60 150;
190 20 250;
20 30 40]
I = zeros(3,3,3);
I(:, :, 1) = R;
I(:, :, 2) = G;
I(:, :, 3) = B;
Ir = rgb2hsv(I);
S = Ir(1,:,2)
% Desired output:
% [0.67 0.74 0.70]
%My output:
% [0.83 0.87 0.87 ]
Accepted Answer
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!