问题:
在如下环境下使用SIFT算法:descriptor = cv2.xfeatures2d.SIFT_create()
python:Python 3.8.6
opencv-python:4.4.0.44
opencv-contrib-python:4.4.0.44
出现如下警告:
[ WARN:0] global c:\users\appveyor\appdata\local\temp\1\pip-req-build-wwma2wne\opencv_contrib\modules\xfeatures2d\misc\python\shadow_sift.hpp (15) cv::xfeatures2d::SIFT_create DEPRECATED: cv.xfeatures2d.SIFT_create() is deprecated due SIFT tranfer to the main repository. https://github.com/opencv/opencv/issues/16736
解决办法:

2020年3月7日后,SIFT的专利将到期,因此应免费使用。 opencv将其移出非自由文件夹将使所有人都能使用默认标志编译opencv并仍然获得SIFT。
所以我们再使用SIFT算法,直接这样写即可:descriptor = cv2.SIFT_create()
- Transfer SIFT to the main repository
- Method and apparatus for identifying scale invariant features in an image and use of same for locating an object in an image
- Where did SIFT and SURF go in OpenCV 3?
- Wrapper package for OpenCV python bindings.
问题:
内存不够
Error:Insufficient memory(Failed to allocate 1244164 bytes) in unknown function
解决办法:
将python的版本升级为64位的!
问题:
缩进不正确
unindent does not match any outer indentation level
解决办法:
python问题unindent does not match any outer indentation level在pycharm平台的解决方法
问题:
OpenCV 4.0.0无法使用drawKeypoints函数
Error is AttributeError: module 'cv2.cv2' has no attribute 'drawKeypoints'
解决办法:
4.0.0版本的缺陷,进行升级即可!
问题:
安装出现以下提示
The directory or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag
解决办法:
安装时在sudo后面加上-H选项,如下命令:sudo -H pip install xxxx
小技巧:
更新pip工具:pip install --upgrade pip
ModuleNotFoundError: No module named ‘pip’解决办法:依次输入以下两条命令-python -m ensurepip和python -m pip install --upgrade pip
列出pip安装的包:pip list
更新某个软件包:pip install --upgrade xxxx
升级 pip 到最新的版本 (>=10.0.0) 后进行配置默认镜像源:
pip install pip -U # 升级pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple #更换为清华镜像源
pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple #更换为华为镜像源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ #更换为阿里镜像源
本文介绍了SIFT算法在Python3.8.6和OpenCV4.4.0.44环境下的使用方法,并解决了相关警告问题。同时,提供了内存不足、缩进错误、drawKeypoints函数缺失等常见问题的解决方案。
9万+

被折叠的 条评论
为什么被折叠?



