def gray2rgb(image):
"""
Grayscale scale image to RGB image
>>> image = np.eye(3, dtype='uint8') * 255
>>> gray2rgb(image)
array([[[255, 255, 255],
[ 0, 0, 0],
[ 0, 0, 0]],
<BLANKLINE>
[[ 0, 0, 0],
[255, 255, 255],
[ 0, 0, 0]],
<BLANKLINE>
[[ 0, 0, 0],
[ 0, 0, 0],
[255, 255, 255]]], dtype=uint8)
:param numpy array image: Numpy array with range [0,255] and dtype 'uint8'.
:return: RGB image
:rtype: numpy array with range [0,255] and dtype 'uint8'
"""
return skc.gray2rgb(image)
评论列表
文章目录