Opencv Installation in Microsoft Visual Studio 2005
Opencv Installation in Microsoft Visual Studio 2005
I. Installation
OpenCV is an open source library for computer vision development. There are some very interesting sample
applications included with this library. Before we can start we need to be able to build the library.
Requirements
• OpenCV Library
• Visual Studio 2005 Express C++
• Windows Platform SDK
Optional
We are going to be using Microsoft Visual Studio for this install. The reasons for this include Support from
OpenCV, Lots of Internet Articles for creating software, MSDN, Offical Software and its FREE.
When you get to Step 3, add this line to "Include Files" (assume default install ___location)
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\mfc
This is because OpenCV requires some files that are inside that folder.
Service Packs for the each of the Visual Studio products are available on one page from Microsoft.
The specific update that you will require is called "C++ 2005 Express Edition SP1 - VS80sp1-KB926748-X86-
INTL.exe"
Go get OpenCV Library and download OpenCV 1.0 for Windows (I use OpenCV beta 5.0a)
In the start menu a folder called "Open CV" was created when you installed OpenCV.
Inside the folder "OpenCV" there is a shortcut called "OpenCV Workspace .NET 2005"
There is one last thing you need to do, to be able to compile OpenCV.
Step 6 - Build
Now that everything is installed and setup; building OpenCV should be a breeze.
Now, we will try to create application based on OpenCV at a glance. First, we will try to create console
application (without Graphical User Interface / GUI)
3. Set additional properties to include OpenCV directory and library, follow these steps :
..\..\cvaux\include\
..\..\cxcore\include\
..\..\cv\include\
..\..\otherlibs\highgui\
..\..\otherlibs\cvcam\include\
“..\..\lib\cv.lib“
“..\..\lib\cvaux.lib“
“..\..\lib\cxcore.lib“
“..\..\lib\cvcam.lib“
“..\..\lib\highgui.lib"
Try to write some simple syntax and compile it (check whether it works or not) :
cvNamedWindow(“test”,1);
How about application with GUI ? We will show you in the next section
III. OpenCV Application with Graphical User Interface
1. Click File >> New >> Project >> Visual C++ >> Windows Forms Application (don’t forget to enter
your application’s name)
2. Set additional directories and libraries, as you do in creating console application (step 3 previous
section).
3. The main important thing, set your general properties of Common Language Runtime Support. To do
this, select your project at the left windows, right click >> Properties >> Configuration Properties >>
General >> Common Language Runtime Support
Change from “Pure MSIL Common Language Runtime Support” to
“Common Language Runtime Support” …….and happy coding !