You are on page 1of 10

Contents

1. 2. 3. Downloading and Installing OpenCV .................................................................................................... 2 Manually Changing the System Path to Include the Bin File ................................................................ 2 Microsoft Visual Studio ......................................................................................................................... 3 Opening the Project .................................................................................................................................. 3 Microsoft Visual Studio with Open CV library........................................................................................... 8

1. Downloading and Installing OpenCV


OpenCV is a computer vision library written mainly in C that focuses on real time video processing. It is open source or free to the public. 1. Go to http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.3/ 2. Select the OpenCV-2.3.0-win-superpack.exe file and download it. 3. Go the folder where you downloaded the executable file in Step 2 and select Run as Administrator. 4. The executable file is essentially an archive of files with an extractor built in. It will ask you to select the location where you would like it to extract all its contents. Select: C:\Program Files\ as the path and click Extract. It will create a folder called OpenCV2.3 with the path: C:\Program Files\OpenCV2.3

2. Manually Changing the System Path to Include the Bin File


1. Go to Control Panel\System and Security\System and on the left hand side select Advanced system settings this should bring up the Systems Properties dialogue. Click on the advanced tab and then the Environment Variables button.

2. This will bring up the Environment Variables dialogue. In the System Variables box select Path and then edit.

3. When modifying the path know that it is sensitive to all characters including spaces. To

add the new bin, type a semicolon directly after the text that is there without adding in a space. Next add the path to the bin file C:\Program Files\OpenCV2.3\build\bin.

3. Microsoft Visual Studio


Opening the Project
Procedural Steps:
1. Go to start Button and click to start Microsoft Visual Studio 2010 Professional. The following windows will appear.

2. Now Click on New Project button.

3. Then open Win32 Console Application and give the name to the project and also set the hard drive path.

4. Window 32 Application Wizard will be opened in a new window. Just click on Finish!

5. Then an Editor window will appear where you can write the source code.

Microsoft Visual Studio with Open CV library


1. Go to Project properties. In the C/C++->General, add the following path in the Additional Include Directories. C:\Program Files\OpenCV2.3\build\include C:\Program Files\OpenCV2.3\build\include\opencv C:\Program Files\OpenCV2.3\build\include\opencv2

2. In the LinkerGeneral, include the following path in the Additional Library Directories and make sure that %(AdditionalLibraryDirectories) should not be erased. C:\Program Files\OpenCV2.3\build\x86\vc10\lib;

3. In the LinkerInput, add the following additional dependencies. "C:\Program Files\OpenCV2.3\build\x86\vc10\lib\opencv_core230d.lib" "C:\Program Files\OpenCV2.3\build\x86\vc10\lib\opencv_highgui230d.lib" "C:\Program Files\OpenCV2.3\build\x86\vc10\lib\opencv_video230d.lib" "C:\Program Files\OpenCV2.3\build\x86\vc10\lib\opencv_ml230d.lib", "C:\Program Files\OpenCV2.3\build\x86\vc10\lib\opencv_legacy230d.lib" "C:\Program Files\OpenCV2.3\build\x86\vc10\lib\opencv_imgproc230d.lib" "C:\Program Files\OpenCV2.3\build\x86\vc10\lib\opencv_cxcore230d.lib"

4. Then Copy the following .dll files into the project Debug folder and the Open CV bin folder. opencv_imageprocd.dll, opencv_highguid.dll, opencv_core230d.dll

You might also like