在python中将图像转换为矩阵 [英] Convert image to a matrix in python

查看:483
本文介绍了在python中将图像转换为矩阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Python进行一些图像处理。

I want to do some image processing using Python.

是否有一种简单的方法可以导入 .png 图像作为灰度/ RGB值的矩阵(可能使用PIL)?

Is there a simple way to import .png image as a matrix of greyscale/RGB values (possibly using PIL)?

推荐答案

scipy.misc。 imread()将返回一个Numpy数组,这对很多东西都很方便。

scipy.misc.imread() will return a Numpy array, which is handy for lots of things.

这篇关于在python中将图像转换为矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆