Python如何图像识别?

Python011

Python如何图像识别?,第1张

打开winPython工具包输入以下代码,如图所示。

from skimage import io

if __name__ == '__main__':

img_name="D:\\WinPython-64bit-3.5.3.0Qt5\\notebooks\\hashiqi.jpg"

print("我的图片!")

img=io.imread(img_name,as_grey=False)

io.imshow(img)

其中变量img_name是为了指定自己图片所存的路径。单击保存按钮,

会跳出一个设置文件名的界面,填入要保存的名字即可。单击运行按钮,一般要单击两次才行,运行代码。单击后,就可以查看的我们显示的图片了。

主流Python图像库:

1.opencv

2.PIL(pillow)

3.matplotlib.image

4.scipy.misc

5.skimage