Reputation:
I have a problem in python opencv!
I want to use SIFT algorithm which is not a default algorithm in opencv package. So I have to build OpenCV with extra modules as bellow:
You can build OpenCV, so it will include the modules from this repository. Here is the CMake command for you:
$ cd <opencv_build_directory>
$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory>
$ make -j5
$ make install
I did all these steps and it was successfully build. But I'm getting error when I call sub modules of opencv (e.g. xfeatures2d, objdetect). I tried using following code;
$ import cv2
$ x = cv2.xfeatures2d()
It gives me error that "module' object has no attribute 'xfeatures2d'".
Do you have any ideas?
Upvotes: 2
Views: 6457
Reputation: 340
opencv_build
opencv_build
directory<opencv_contrib>
points to downloaded folder from step 1<opencv_source_directory>
points to downloaded folder from step 2Upvotes: 2