rgb2hsv — Converts from RGB to HSV colorspace.
HSV = rgb2hsv(RGB)
HSVMAP = rgb2hsv(RGBMAP)
rgb2hsv(RGB)
converts an RGB image or colormap to
the HSV colorspace. The HSV model separates Hue (color)
Saturation (ammount of color) and Value (intensity). It is
much more useful for manipulation than the RGB space and also
for segmenting images by color.
rgb = imread(SIPDIR + 'images/tru.jpg'): xbasc(); imshow(rgb); hsv = rgb2hsv(rgb); xbasc(); imshow(hsv(:,:,3)) // intensity imshow(hsv(:,:,1)) // hue (color component) hsv(:,:,2) = 1 // saturate the image rgb = hsv2rgb(hsv); xbasc(); imshow(rgb); // You may also convert a single triplet: rgb2hsv([1 1 0])