rgb2hsv

rgb2hsv

skimage.color.rgb2hsv(rgb) [source]

RGB to HSV color space conversion.

Parameters:

rgb : array_like

The image in RGB format, in a 3-D array of shape (.., .., 3).

Returns:

out : ndarray

The image in HSV format, in a 3-D array of shape (.., .., 3).

Raises:

ValueError

If rgb is not a 3-D array of shape (.., .., 3).

Notes

The conversion assumes an input data range of [0, 1] for all color components.

Conversion between RGB and HSV color spaces results in some loss of precision, due to integer arithmetic and rounding [R51].

References

[R51] (1, 2) http://en.wikipedia.org/wiki/HSL_and_HSV

Examples

>>> from skimage import color
>>> from skimage import data
>>> img = data.astronaut()
>>> img_hsv = color.rgb2hsv(img)
doc_scikit_image
2017-01-12 17:23:15
Comments
Leave a Comment

Please login to continue.