Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing #5

Open
SanaSarfraz98 opened this issue May 24, 2022 · 2 comments
Open

testing #5

SanaSarfraz98 opened this issue May 24, 2022 · 2 comments

Comments

@SanaSarfraz98
Copy link

while running the testing file (Feature Descriptor section), I am facing this error. Used multiple ways to resolve the issue but couldn't succeed. Please guide me in this. Thanks

OpenCV(4.5.5) D:\a\opencv-python\opencv-python\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 'cv::xfeatures2d::SURF::create'

@Tanush-J
Copy link

try using ORB instead of SURF,you can refer to this:
tutorialspoint.com/how-to-implement-orb-feature-detectors-in-opencv-python

@leila4793
Copy link

Hi, the error occurs because the SURF algorithm is patented, and it is not included in the default build of OpenCV. To resolve this issue, you need to enable the nonfree modules in OpenCV by rebuilding the library. Here’s how you can do it:

  1. Download OpenCV Source Code:

Go to the OpenCV GitHub repository and download the source code.
Download the opencv_contrib repository as well.

  1. Install Required Tools: Install CMake, Python, and a C++ compiler (e.g., Visual Studio on Windows or GCC on Linux).
  2. Configure OpenCV Build with CMake:
    Run CMake and set the OPENCV_ENABLE_NONFREE option to ON.
    Include the opencv_contrib modules by specifying the path to the opencv_contrib/modules folder in the OPENCV_EXTRA_MODULES_PATH variable.

4.Build OpenCV: Run the build command (make on Linux or use the Visual Studio project files generated by CMake on Windows). Install the rebuilt library.

  1. Update Your Environment: Update your Python environment or project to use the newly built OpenCV library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants