将图像从RGB转换为HSV色彩空间 [英] Converting image from RGB to HSV color space
问题描述
我在Scipy
或Matplotlib's
文档中找不到这样的功能(即RGB_to_HSV()
),并且Google除了[c3>配方中展示了rgb2hsv
功能之外,没有显示指针,尽管在ActiveState
上不可用Numpy
数组保持不变.
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.
有人知道快捷方式吗?
对不起,刚刚找到matplotlib.colors.rgb_to_hsv()
,这正是我想要的.我应该删除这个问题吗?
Sorry, just found matplotlib.colors.rgb_to_hsv()
which is exactly what I was looking for. Should I delete this question?
推荐答案
Matplotlib提供RGB到HSV转换功能: matplotlib.colors.rgb_to_hsv():
Matplotlib provides RGB to HSV conversion function: matplotlib.colors.rgb_to_hsv():
matplotlib.colors.rgb_to_hsv(arr)
将numpy数组中的rgb值转换为hsv值,输入和输出数组应具有(M,N,3)形状
convert rgb values in a numpy array to hsv values input and output arrays should have shape (M,N,3)
这篇关于将图像从RGB转换为HSV色彩空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!