我正在嘗試使用 PIL.Image.save() 將一個 numpy 陣列保存為 RGB 影像,但保存的影像不是 RGB。如何將影像保存為 RGB ?我以 numpy 陣列的形式接收影像。
image_with_detections = np.array(image_with_detections)
image = Image.fromarray(image_with_detections.astype('uint8'), 'RGB')
image.save(save_path)
該鏈接到原始影像的鏈接),以影像保存的Image.save(
uj5u.com熱心網友回復:
您可以執行以下操作
image_with_detections = np.array(image_with_detections)
image = Image.fromarray(image_with_detections.astype('uint8'), 'RGB')
image = image[:,:,::-1]
image.save(save_path)
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/403281.html
標籤:
