Monday, March 22, 2010

Configure OpenCV with Visual Studio 2008 in Windows Xp

These days I'm working on my final year project 'Real Time Sign Language recognition system' .I get the input from using a normal web camera and system will identify the hand posture or gesture.So in here i have to deal with technologies like Computer Vision,Image Processing and Machine Learning.Then I found a very powerful very powerful computer vision Library called OpenCV (Open Source Computer Vision).OpenCV library written mainly in C that focuses on real time video processing.In this post is about how to Install OpenCV in windows XP machine and and how to configure Opencv with Visual studio 2008

1. Download the openCV
OpenCv is available at http://sourceforge.net/projects/opencvlibrary/. For may project im using openCV 1.0. To download OpenCV 1.0 click 'View all Files' and then u can Download openCV 1.0 for windows.





2.Install Opencv


After install the openCV make sure that to set System Properties->Environment Variable-> Path to the bin folder in OpenCV

After that restart Your machine

Then go to ..OpenCV\samples\c folder.Then you can see lot of samples their.Try to run those samples.If those samples are run without an error your openCV installation is successful.

3. Opencv Configure with Visual Studio 2008

Create new Win32 Concole application.



Go to Properties


In the Project Properties Page go to Configuration Properties -> C/C++ ->General



To set 'Additional Include Directories' copy and paste the following text:

"C:\Program Files\OpenCV\cxcore\include";"C:\Program Files\OpenCV\cv\include\";"C:\Program Files\OpenCV\cvaux\include";"C:\Program Files\OpenCV\otherlibs\highgui"
Change above according to your installation path

Next Project Properties Page go to Configuration Properties -> Linker ->Inputs


To set 'Additional Dependencies' copy and paste following text:

"C:\Program Files\OpenCV\lib\cv.lib" "C:\Program Files\OpenCV\lib\cvaux.lib" "C:\Program Files\OpenCV\lib\cxcore.lib" "C:\Program Files\OpenCV\lib\highgui.lib"

In here is space separation, Instead of above semicolon (;) seperation

Now your all configuration is finish.Then you can copy source code from samples folder and and run in the Visual Studio 2008 environment