MATLAB: How to range the value of h component between [0 1]

h componentrange

i want to limit the range of h component between [0 1]

Best Answer

rgb = imread('peppers.png');
hsv = rgb2hsv(rgb);
h = hsv(:, :, 1);
min(min(h))
max(max(h))
ans =
0
ans =
0.99914089347079
Are you talking about hsv color space? It already seems to be limited to the range 0-1 as you can see above.