python实现opencv学习一:安装、环境配置、工具

版权声明:转载请联系 :[email protected] https://blog.csdn.net/weixin_40928253/article/details/89631489

一、安装python

https://www.python.org/downloads/

过程就不在此赘述了,详情请参考:

https://blog.csdn.net/weixin_40928253/article/details/89360419

二、安装pip(通用的 Python 包管理工具,提供了对 Python 包的查找、下载、安装、卸载的功能)

过程就不在此赘述了,详情请参考:

https://blog.csdn.net/weixin_40928253/article/details/89360419

主要过程:

查看版本:pip show pip

升级pip版本:python -m pip install --upgrade pip

三:安装wheel

pip install wheel

四:安装numpy

pip install numpy

五:安装opencv

pip install opencv-python

到此,opencv-python安装3完毕。

六、测试

新建python文件,输入以下代码,并把“1.jpg”文件放于同一目录下。

import cv2
import numpy as np


if __name__ == "__main__":
    img = cv2.imread("1.jpg")
    cv2.imshow("1", img)
    cv2.waitKey(1000)

显示出图片即为成功。

OKK!!!

猜你喜欢

转载自blog.csdn.net/weixin_40928253/article/details/89631489