pythoncharm如何安装opencv_PyCharm安装opencv-python和opencv-contrib-python的一些问题和解决方法_2018-09-27...

在使用PyCharm时,遇到安装opencv-python后无法使用xfeatures2d模块的问题。通过将opencv的Python文件复制到Python安装目录,或在Windows下安装opencv-contrib-python时遇到ReadTimeoutError。最终通过在不同环境中尝试安装、复制库文件以及检查PyCharm环境变量设置,成功解决问题,并能使用SIFT等算法。
摘要由CSDN通过智能技术生成

当我想要在python上测试FeatureDetector并使用OpenCV的SIFT时,由于我在pycharm上仅仅安装了opencv-python,所以会出现报错(忘记截图了,好像是:'module' object has no attribute 'xfeatures2d'。大致意思是说找不到 xfeatures2d 的库)。

2018.9.30更新:

Windows环境下把opencv中python的py文件复制到python安装位置的package 里。

linux下载opencv-python!

——来源:python opencv 怎么安装xfeature2d.extra 2d features framework_百度知道

https://zhidao.baidu.com/question/2079216204608995428.html

——在OpenCV3.1.0中使用SIFT,SURF算法-布布扣-bubuko.com

http://www.bubuko.com/infodetail-1285356.html

别人出现的相同报错:

cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv_contrib\modules\xfeatures2d\src\sift.cpp:1207: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'cv::xfeatures2d::SIFT::create'

于是想要在pycharm上安装 opencv-contrib-python。但是在这个过程中出现了了另一个问题:老是安装不上opencv-contrib-python,总是会出现以下的错误:

pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

在cmd里运行pip install opencv-contrib-python也会出现以下提示:

C:\Users\Administrator>pip install opencv-contrib-python

Requirement already satisfied: opencv-contrib-python in c:\users\administrator\a

ppdata\roaming\python\python36\site-packages (3.4.3.18)

Requirement already satisfied: numpy>=1.11.3 in e:\anaconda3\lib\site-packages (

from opencv-contrib-python) (1.14.3)

然后网上的相关资料建议我先把opencv-python给卸载(uninstall,点击pycharm中file菜单栏的setting后的减号“—”),我照做了,但是试了很多次,发现后面安装不回来......

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值