Sunday, December 27, 2015

Building OpenCV with face module (opencv_contrib) from sources on Windows 7 64 bit

Thanks for help to : 

My env : 
1. Windows 7 64 bit
2. Anaconda 64 bit python
3. Visual Studio 12 2013

Steps : 
1. mkdir opencv
2. cd opencv; mkdir build; mkdir src;
3. In src created above, unzip zip from opencv source obtained from here : src should contain 3rdparty,apps,cmake etc folders
4. get opencv_contrib sources from unzip and copy required modules (for e.g. face) from its modules folder to src/modules above.
5. create directory build at the same level as src above.
6. download cmake for windows. open cmake gui. select build and src folders created above.
7. Click Configure. Select generator as Visual Studio 12 2013 Win64 (notice my env above, if you have a different env, tinker a bit)
8. Once done with configuration, select required modules (for e.g. face) and hit Generate.
9. In the build folder you will see OpenCV.sln is created. Open it with Visual Studio.
10. Locate ALL_BUILD in Solutions Explorer. Right click and Build.
11. cv2.pyd is created in build/lib/Release. Copy this to C:\Anaconda\Lib\site-packages
12. Add the complete path of build\bin\Release to your PATH environment variable.

No comments:

Blog Archive