Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (50.2k points)

I am trying to create the extra modules (opencv_contrib) into OpenCV and for that, I am using OpenCV 3.1.0, Python 2.7.11, and Windows 10.

I have done the below task:

$ cd <opencv_build_directory>

$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory>

$ make -j5

But when I execute this code, I am getting the error message:

cmake _DOPENCV_EXTRA_MODULES_PATH=C:\opencv_contrib\opencv_contrib/modules C:\opencv\sources. 

Kindly check the below image:

enter image description here

1 Answer

0 votes
by (108k points)

Kindly refer to the below steps:

1. Install and download the Visual Studio 2013, CMake, opencv, and opencv_contrib.

2. Create a folder as opencv-3.1.0-dev and in this directory create other two folders one called to build and the other called sources. The paths will look like this: 

opencv-3.1.0-dev\build and opencv-3.1.0-dev\sources.

3. Then unzip opencv-master.zip and opencv_contrib-master.zip

4. In the sources directory created in step 3, paste opencv and opencv_contrib directories

5. Then open CMake and provide two paths, one for the build directory and the other for the sources directory

6. Press configure, a lot of lines highlighted in red will appear. Also, select the correct bit version based on your needs, same procedure works for 32-bit and 64-bit

7. Select whatever you want to create, and also provide the path of the non-free modules.

8. After that press the configure button again and new lines will be highlighted in red.

9. Make sure that you do not select BUILD_opencv_contrib_world before pressing generate

10. The last step with CMake is to press generate.

11. Make sure generating is done before continuing. After that, open the build that was empty, and you will find a bunch of files. The most important file is OpenCV.sln. Right-click on the .sln file and start it with the visual studio 2013 that is used in CMake.

12. Create the 3 files with the order. Change the mode into Release. These steps take some what around 10 to 15 minutes.

13. then, copy all the .dll files that are present at opencv-3.1.0-dev\build\bin\Release directory and the cv2.pyd and paste them in the site-packages directory in Pyhton27\Lib\site-packages.

14. To verify the build open Python and execute import cv2. If there are no errors then, execute cv2.__version__, and you should get 3.1.0-dev.

Sign up for this Intellipaat's Python Course fast, to Learn Python concepts in detail and get certified. 

Related questions

0 votes
1 answer
asked Jul 11, 2020 in Python by ashely (50.2k points)
0 votes
1 answer
asked Oct 3, 2019 in Python by Sammy (47.6k points)
0 votes
4 answers
0 votes
1 answer
0 votes
1 answer

Browse Categories

...