I’m encountering issues with using the SURF algorithm in OpenCV, even after manually building opencv-contrib-python. Following the steps outlined below:
Navigated to the opencv-python directory: cd opencv-python
Selected the package flavor: export ENABLE_CONTRIB=1
Ran pip wheel: pip wheel . --verbose
Even though I managed to build it successfully, I’m still unable to use the SURF function and keep getting the error message 'AttributeError: module ‘cv2.cv2’ has no attribute ‘xfeatures2d’.’ I’m reaching out for help to resolve this issue.
Thank you for your prompt reply. I followed your suggestion and uninstalled both opencv-python and opencv-contrib-python. Then, I reinstalled opencv-contrib-python. However, I’m still encountering the same error. Do you have any further suggestions on how to resolve this issue?
I tried your suggestion, but unfortunately, I’m still encountering the same issue. Specifically, I’m getting an AttributeError: module ‘cv2’ has no attribute ‘xfeatures2d’ when running my code.
sorry, but that’s a useless screenshot, it’s truncated, and it does not show, which modules are built or not. (or even if you had contrib repos or not)