In the experiment of digital image processing course, SIFT algorithm is used in the feature matching experiment, and opencv4 is used for the first time with vscode 4 and python 3 8. An error is reported
module 'cv2.cv2' has no attribute 'xfeatures2d'
Then install the opencv Python 126.96.36.199 command in Anaconda prompt as follows, and an error occurs that the relevant version cannot be found
pip install opencv-python==188.8.131.52
And report an error as
cv2.error: OpenCV(3.4.8) 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'
The reason for the first error is opencv4 Version 4 cannot be used due to sift patent; The second error is due to opencv4 2 and python 3 8 mismatch, need to be reduced to 3.6; This error is still a problem with the opencv version
If it’s Python 3.6. You only need to install the package of the relevant version of OpenCV. Execute the following command in Anaconda prompt
pip install opencv-python==184.108.40.206 pip install opencv-contrib-python==220.127.116.11
Because I’m Python 3.8. Therefore, a virtual environment py36 is created for related configuration. For creating a virtual environment and activating a virtual environment, please refer to the creating a virtual environment – brief book in Anaconda blog, and then execute the above command in the activated virtual environment
Finally, run the PY file in the vs Code terminal
- [Solved] opencv-python: recipe for target ‘modules/python3/CMakeFiles/opencv_python3.dir/all‘ failed
- [Solved] Cv2.imshow Error: window.cpp:1274: error: (-2:Unspecified error) The function is not implemented.
- [Solved] Pyinstaller package opencv error: ImportError: OpenCV loader: missing configuration file: [‘config.py’]. Check OpenCV installation.
- How to Fix Errors encountered in executing Python scripts with command line parameters
- Import CV2 & Numpy report red Warning and Error [How to Solve]
- ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
- [Solved] Import cv2 Error: ImportError: libGL.so.1: cannot open shared object file: No such file or directory
- [Solved] ERROR: No matching distribution found for torch-cluster==x.x.x
- [Solved] AttributeError: ‘module‘ object has no attribute ‘CALIB_HAND_EYE_PARK‘
- The PIP installation package was successful but the import failed
- Windows10 DOTA_devkit Error: TypeError: ‘＞=‘ not supported between instances of ‘NoneType‘ and ‘str‘
- Raspberry pie compilation and installation opencv error: fatal error: bootdesc_bgm.i: No such file or directory
- Error in sitecustomize set PYTHONVERBOSE for traceback KeyError: ‘PYTHONPATH’
- [Solved] cv2.error: (-215:Assertion failed) encoder-＞isFormatSupported(CV_8U) in function ‘imwrite_‘
- error: Unable to find vcvarsall.bat
- Python environment error, bad interpreter: there is no file or directory
- [Solved] Pycharm Use pip Error: Script file ‘D:\Anaconda3\envs\pytorch\Scripts\pip-script.py‘ is not present
- Pycharm error: original error was: DLL load failed while importing _multiarray _Umath: the specified module could not be found
- Opencv Python realizes the paint filling function in PS, one click filling color and the possible reasons for opencv’s frequent errors
- [Solved] Python Networkx Error: Network error: random_state_index is incorrect