How to use opencv_contrib functions?
I have installed opencv and opencv_contrib in a conda environment using pip. Though I am getting this error :
cv2.error: OpenCV(4.1.0) /io/opencv_contrib/modules/xfeatures2d/src/surf.cpp:1029: 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 'create'
How to solve this? Do I need to download and build opencv from the github? If yes, then how?
you have to build opencv_contrib yourself using cmake and your favourite C++ compiler
@LBerger said, you don't have to re-install agian. You simply deleting inside build' s folder and then do cmake. For python 3.x used
pip3
.@supra56, the pip maintainer choose not to enable the OPENCV_ENABLE_NONFREE flag (a concious decision) so no pip built opencv_contrib_python after 3.2 will have SIFT or SURF, meaning:
if you need it, you HAVE to build locally from src. please do not blindly recommend to use pip here.