Python 官方文档:入门教程 => 点击学习
OpenCV的作用及安装 OpenCV简介 OpenCV是一个开源的跨平台计算机视觉库,可以运行在linux、windows、Android和Mac OS操作系统上。提供了pytho
OpenCV是一个开源的跨平台计算机视觉库,可以运行在linux、windows、Android和Mac OS操作系统上。提供了python、Ruby、MATLAB等语言的接口,并且实现了图像处理和计算机视觉方面的很多通用算法,可以给开发者调用。
mac上安装opencv时,一开始使用pip3 install python-opencv时报错,提示:No matching distribution found for Python-opencv,使用pip3 install opencv,也报错,提示找不到opencv,如图
alicedembp:~ alice$ pip3 install python-opencv
Collecting python-opencv
Could not find a version that satisfies the requirement python-opencv (from versions: )
No matching distribution found for python-opencv
后来重新反过来试了一下pip3 install opencv-python,居然成功了 ,如图
alicedembp:~ alice$ pip3 install python-opencv
Collecting python-opencv
Could not find a version that satisfies the requirement python-opencv (from versions: )
No matching distribution found for python-opencv
alicedembp:~ alice$ pip3 install opencv-python
Collecting opencv-python
Downloading https://files.pythonhosted.org/packages/8d/ff/13e77ee7ac431f831e20d81a6bf0214ca1cf550cf9b575e3213e14325c81/opencv_python-4.1.0.25-cp37-cp37m-macosx_10_7_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (52.1MB)
100% |████████████████████████████████| 52.1MB 735kB/s
Requirement already satisfied: numpy>=1.14.5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from opencv-python) (1.16.1)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.1.0.25
alicedembp:~ alice$
可以在终端使用命令行import cv2检验一下是否真的成功了
alicedembp:~ alice$ python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more infORMation.
>>> import cv2
>>>
导入时无出错提示,确认已成功~也可通过cv2.__version__查看安装的版本,示例如下:
alicedembp:~ alice$ python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'4.1.0'
到此这篇关于python之OpenCV的作用以及安装案例教程的文章就介绍到这了,更多相关python之OpenCV的作用及安装内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!
--结束END--
本文标题: python之OpenCV的作用以及安装案例教程
本文链接: https://lsjlt.com/news/130829.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0