Image Processing Toolbox | ![]() ![]() |
Convert RGB values to hue-saturation-value (HSV) color space
Syntax
hsvmap = rgb2hsv(rgbmap) HSV = rgb2hsv(RGB)
Description
hsvmap = rgb2hsv(rgbmap)
converts the m
-by-3 RGB values in RGB
to HSV color space. hsvmap
is an m
-by-3 matrix that contains the hue, saturation, and value components as columns that are equivalent to the colors in the RGB colormap. Both rgbmap
and hsvmap
are of class double
and contain values in the range 0 to 1.0.
HSV = rgb2hsv(RGB)
converts the truecolor image RGB
to the equivalent HSV image HSV
.
Class Support
If the input is an RGB image, it can be of class uint8
, uint16
, or double
; the output image is of class double
. If the input is a colormap, the input and output colormaps are both of class double
.
Remarks
rgb2hsv
is a function in MATLAB.
See Also
colormap
in the MATLAB Function Reference
![]() | rgb2gray | rgb2ind | ![]() |