【问题标题】:Need help convert numpy array image to image with full color需要帮助将 numpy 数组图像转换为全彩色图像
【发布时间】:2021-05-01 16:03:03
【问题描述】:

需要帮助将 numpy 数组图像转换为全彩色图像 我必须使用 PIL,因为完成此过程后我会将图像上传到 ftp 服务器

谢谢

【问题讨论】:

标签: python numpy


【解决方案1】:

cv2 使用 BGR,Image 使用 RGB。所以恢复频道顺序会起作用

Image.fromarray(numpy_array[:,:,::-1].astype('uint8'))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-10-05
    • 2015-05-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-28
    • 1970-01-01
    相关资源
    最近更新 更多