[Python数字图像处理] 一、环境搭建

[Python数字图像处理]-环境搭建

1、系统与python安装

本文适用于Windows 64位系统下的Pthon3.7版本。python可在官网下载:
https://www.python.org/downloads/windows/ ,安装完毕后在操作系统的环境变量中配置好python的安装路径

2、扩展库安装

以管理员身份运行CmdPowershell,输入以下命令

    pip install --upgrade setuptools
    pip install scipy
    pip install numpy
    pip install Matplotlib
    pip install opencv-python 
    pip install pillow

如果出现库安装出现超时或安装失败,可以设置国内源下载
清华源https://pypi.tuna.tsinghua.edu.cn/simple/

    pip install --upgrade setuptools -i https://pypi.tuna.tsinghua.edu.cn/simple/
    pip install scipy -i https://pypi.tuna.tsinghua.edu.cn/simple/
    pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple/
    pip install Matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple/
    pip install opencv-python  -i https://pypi.tuna.tsinghua.edu.cn/simple/
    pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple/

3、测试

#导入cv模块
import cv2 as cv
#读取图像,支持 bmp、jpg、png、tiff 等常用格式
img = cv.imread("test.jpg")
#创建窗口并显示图像
cv.namedWindow("Image")
cv.imshow("Image",img)
cv.waitKey(0)
#释放窗口
cv2.destroyAllWindows() 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值