1.1配置python环境及编译器(Pycharm)下载
进入Pycharm官网下载Pycharm PyCharm: the Python IDE for Professional Developers by JetBrainshttps://www.jetbrains.com/pycharm/
进入Python官网下载最新版本Python
Download Python | Python.orghttps://www.python.org/downloads/安装细则可参照博客(36条消息) python,pycharm的安装及其环境变量的配置_zh_huan的博客-CSDN博客_pycharm需要配置环境变量吗https://blog.csdn.net/zh_huan/article/details/100590242?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522166766627716782425624636%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=166766627716782425624636&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-100590242-null-null.142%5Ev63%5Ewechat,201%5Ev3%5Econtrol_1,213%5Ev1%5Et3_esquery_v2&utm_term=pychrm%E9%85%8D%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F&spm=1018.2226.3001.4187
1.2配置中文插件
1.打开Pycharm,点击Settings进入设置
2.进入Settings后选择Plugins,在又侧搜索框搜索“Chinese”
3.点击Installed(下载插件)下载后应用
4.关闭当前窗口后跳出下列窗口点击Restart按钮系统将会重启Pycharm
5.重启后中文插件生效
1.3添加Opencv-Python的软件包
1.选择“文件”点击“设置”
2.点击“项目”->“Python解释器”->“+”号,添加软件包
3.搜索opencv-python选择opencv-python,点击“安装软件包”
5. 当显示安装成功opencv-pythong软件包即成功安装
1.4 测试opencv-python环境
1.将一张图片(文件名为logo2.jpg)复制粘贴到项目文件目录下(注:最外层文件夹)
2.图片将添加到大目录下
3.输入以下代码,编译运行(Alt+Shift+F10)
import cv2
lena = cv2.imread("logo2.jpg")
print(lena)
4.运行没有报错即opencv-python软件包安装成功