Convert RGB colormap to HSV colormap
H = rgb2hsv(M)
hsv_image = rgb2hsv(rgb_image)
H = rgb2hsv(M)
converts
an RGB colormap M
to an HSV colormap H
.
Both colormaps are m-by-3 matrices. The elements
of both colormaps are in the range 0 to 1.
The columns of the input matrix M
represent
intensities of red, green, and blue, respectively. The columns of
the output matrix H
represent hue, saturation,
and value, respectively.
hsv_image = rgb2hsv(rgb_image)
converts the RGB image to the equivalent HSV image. rgb_image
is
an m-by-n-by-3 image array whose
three planes contain the red, green, and blue components for the image.
HSV is returned as an m-by-n-by-3
image array whose three planes contain the hue, saturation, and value
components for the image.
If the input is an RGB image, it can be of class uint8
, uint16
, single
,
or double
. The output image is single
when
the input is single
. For all other input data types,
the output image is double
. If the input is a colormap,
the input and output colormaps are both of class double
.