天天看點

【python】将單通道圖像轉換為3通道圖像

#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)
           

繼續閱讀