theta
theta

Reputation: 25631

Converting image from RGB to HSV color space

I couldn't find such function (i.e. RGB_to_HSV()) in Scipy or Matplotlib's documentations, and Google doesn't show pointers, except ActiveState recipe which demonstrates rgb2hsv function, though not usable on Numpy array as is.

Does someone know of a shortcut?


Edit: Sorry, just found matplotlib.colors.rgb_to_hsv() which is exactly what I was looking for. Should I delete this question?

Upvotes: 28

Views: 34453

Answers (1)

theta
theta

Reputation: 25631

Matplotlib provides RGB to HSV conversion function: matplotlib.colors.rgb_to_hsv():

matplotlib.colors.rgb_to_hsv(arr)

convert rgb values in a numpy array to hsv values input and output arrays should have shape (M,N,3)

Upvotes: 53

Related Questions