【问题标题】:how to open image as rgb file when using imageio使用imageio时如何将图像打开为rgb文件
【发布时间】:2018-09-17 00:05:00
【问题描述】:

我有一个使用scipy.misc的现有代码段读取图像

imref = misc.imread(self.file_image, False, "RGB")

如果我想用 imageio 替换它,该怎么做,我可以使用吗

imref = imageio.imread(self.file_image, False). 

我不清楚在使用imageio.imread 时在哪里设置"RGB" 参数。

【问题讨论】:

    标签: python image-processing scipy python-imageio


    【解决方案1】:

    正如docs 中所述,您可以使用关键字参数pilmode 来指定模态,而scipy flattenas_gray 替换。所以在你的情况下:

    imref = imageio.imread(self.file_image, as_gray=False, pilmode="RGB")
    

    【讨论】:

      【解决方案2】:

      如果您收到错误消息:“Imageio Pillow 插件需要 Pillow lib”怎么办?

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2010-09-20
        • 1970-01-01
        • 2019-07-04
        • 2019-10-12
        • 1970-01-01
        • 2019-07-26
        • 1970-01-01
        相关资源
        最近更新 更多