Wednesday, June 25, 2014

Configure OpenCV on Visual Studio 2010

[20130831] August 31st 2013

I assume that you installed both Visual Studio 2010 and OpenCV on Windows 7 x86. Version of OpenCV I have tested is v2.4.6. Remember to change my path example to your path suitably.
1. Set up environment
System properties > Environment variables > System variables > New
Create pair: [Name, Value] = [OPENCV_DIR, Z:\Software\OpenCV\opencv\build]
Add this value to Path variable (in System variables): ;%OPENCV_DIR%\x86\vc10\bin\;
2. Modify your project's properties in VS2010
(C/C++) (General) (Additional Include Directories) = Z:\Software\OpenCV\opencv\build\include
(Linker) (General) (Enable Incremental Linking) = No (/INCREMENTAL:NO)
(Linker) (General) (Additional Library Directories) = Z:\Software\OpenCV\opencv\build\x86\vc10\lib
(Linker) (Input) (Additional Dependencies) = 
opencv_core246d.lib
opencv_highgui246d.lib
opencv_imgproc246d.lib

3. Include libraries to your code
...
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
...
using namespace cv;


Some useful links

No comments:

Post a Comment