Home of the wacky and crazy projects
Installing OpenCV with Microsoft Visual Studio 2005 C++
OpenCV stands for Open Computer Vision Library.
OpenCV is an open source library for computer vision development. There are some very interesting sample applications included with this library.
This sounds like the perfect start for Sir Bones.
Before we can start we need to be able to build the library.
Requirements
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.
Step 1 – Installing Visual C++ and Platform SDK
Visit http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ and follow Microsofts Guide to setup Visual C++ and the Platform SDK.
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.
Step 2 – Update Visual C++ with Service Pack 1 (Optional)
Service Packs for the each of the Visual Studio products are available on one page from Microsoft.
Visual Studio 2005 Express SP1
The specific update that you will require is called "C++ 2005 Express Edition SP1 – VS80sp1-KB926748-X86-INTL.exe"
Step 3 – Install OpenCV
Go get OpenCV Library and download OpenCV 1.0 for Windows
Installation is straight forward.
Step 4 – Customising Visual C++ for use with OpenCV
We need to setup the directories for Open Visual C++
- Open Visual C++
- Choose menu "Tools" and select "Options"
- In "Projects and Solutions" and go to "VC++ Directories"
- Show directories for "Library Files"
- Add "C:\Program Files\OpenCV\lib" to the list of directories
Step 5 – Open "OpenCV Workspace .NET 2005"
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"
Open "OpenCV Workspace .NET 2005"
This will load OpenCV solution within Visual C++
There is one last thing you need to do, to be able to compile OpenCV.
- Choose menu "Build" and Select "Configuration Manager"
- Change "Active solution configuration" to either "Debug" or "Release"
Step 6 – Build
Now that everything is installed and setup; building OpenCV should be a breeze.
- Choose menu "Build" and Select "Build Solution"
Building OpenCV can take anywhere from a few minutes to an hour.
When I built OpenCV it took about 10 minutes.< /p>
Congratulations OpenCV is now installed and built.
| Print article | This entry was posted by Dan on January 10, 2007 at 10:37 pm, and is filed under C/C++, Hacking, Languages, Software, sirBones. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
about 3 years ago
I happen to be reading Robin Hewitt’s article on OpenCV in the Jan-2007 Servo Magazine and decided to download OpenCV and MS VC++ Express. While I was downloading I thought I’d check to see if anyone else had gotten the two to work together. Thanks for the time saver!
Dave
http://home.comcast.net/~ellis76016/robots/
about 3 years ago
Thanks for the tutorial!
about 3 years ago
Actually, this didn’t work for me and I ended up linking to the DLL’s included with the OpenCV Windows package.
about 3 years ago
What when wrong?
about 3 years ago
It might have had something to do with bugs introduced in OpenCV version 1.0. This stuff is over my head, but you might want to check it out – http://zebulon.sourceforge.net/wiki/index.php/Visual_Studio_2005#OpenCV
about 1 year ago
Thanx for a great and easy tutorial.
I followed your steps one by one and it was up and running in less than 10 minutes.
about 1 year ago
i like it, it’s easy
about 1 year ago
I understand how the setup described on this page includes the library directory:
“C:\Program Files\OpenCV\lib”
But it did not show to include source directories and include directories, such as:
“C:\Program Files\OpenCV\cv\include”
and
“C:\Program Files\OpenCV\cxcore\src”
This seemed to work better for me:
http://opencv.willowgarage.com/wiki/VisualC%2B%2B