Monday, January 12, 2009

How to create a new OpenCV project with Visual Studio 2003 or 2005

1. In order to install OpenCV you need to download it from
sourceforge.net/projects/opencvlibrary

2. Then on the project you need to change the following settings:

3. On properties project-> Configuration properties do the following :
C/C++ -> General-> Additional Include Directories enter:

"C:\Program Files\OpenCV\cxcore\include";
"C:\Program Files\OpenCV\cv\include";
"C:\Program Files\OpenCV\cvaux\include";
"C:\Program Files\OpenCV\otherlibs\highgui";
"C:\Program Files\OpenCV\otherlibs\cvcam\include"

4. Under Linker->General->Additional Library Directories enter:
"C:\Program Files\OpenCV\lib"

5. Under Linker->Input->Additional Dependencies (libraries) enter:
cv.lib cxcore.lib highgui.lib


6. Add this header files on your project after "stdafx.h"
#include "cv.h"
#include "cxcore.h"
#include "highgui.h"