#single channel image
# shape of img is [x, y]
# repeat as three channels
# shape of img_3channel is [x, y, 3]
img_3channel = np.repeat(img[..., np.newaxis], 3, 2)
【python】将单通道图像转换为3通道图像
最新推荐文章于 2022-08-30 10:35:51 发布
#single channel image
# shape of img is [x, y]
# repeat as three channels
# shape of img_3channel is [x, y, 3]
img_3channel = np.repeat(img[..., np.newaxis], 3, 2)