Opencv Under Microsoft Visual C++ 2008 Express Edition (Winxp)
Opencv Under Microsoft Visual C++ 2008 Express Edition (Winxp)
This is a small walkthrough which I put together while I tried to run OpenCV using
MS Visual C++ 2008 Express Edition. This document is mainly based on
http://myopencv.blogspot.com/2008/09/visual-c-and-opencv.html and
http://opencvlibrary.sourceforge.net/wiki-static/VisualC(2b2b).html
3. Register it http://www.microsoft.com/express/registration/Default.aspx (
Help->Register Product.)
a. You will receive email with link to confirm your email address
b. Then you will receive another email with link to the registration
number
4. Once you have your VC++ registered and it's ready to use, you need to
customize Global Options so that you can use OpenCV libraries.
• First, from the "Show Directories for:" list box choose "Include Files".
(“Platform” list box should show “Win32”), see screenshot
• Click the Insert New icon, and locate the folder where you have installed
OpenCV. Let’s consider that it is installed in "C:\Program Files\OpenCV\"
• Next, choose "Source Files" in the list box, and locate and add the
following directories:
"C:\Program Files\OpenCV\cv\src"
"C:\Program Files\OpenCV\cxcore\src"
"C:\Program Files\OpenCV\cvaux\src"
"C:\Program Files\OpenCV\otherlibs\highgui"
"C:\Program Files\OpenCV\otherlibs\cvcam\src\windows"
"C:\Program Files\OpenCV\ml\src"
"C:\Program Files\OpenCV\otherlibs\_graphics\src"
5. Download some OpenCV examples, e.g. from
http://web.tagus.ist.utl.pt/~alexandra.ribeiro/tutorialopencv.html . I managed
to run only the first example (showing picture of a hand) and the 3rd (camera
capture).
Let's try the 3rd example now. You will need a camera connected to your PC.
I’ve tested the code using Logitech Quickcam. I would recommend testing
your camera on http://www.testmycam.com/ before running the code.
6. Unrar http://web.tagus.ist.utl.pt/~alexandra.ribeiro/TFC/OpenCV/exemplo3-
tutorialOpenCV.rar to the folder where you keep your projects (e.g.
C:\development\).
10. Add the filenames of all necessary import libraries : cxcore.lib cv.lib
highgui.lib cvaux.lib cvcam.lib . You can find them in C:\Program
Files\OpenCV\lib . In this example only cxcore.lib cv.lib highgui.lib has been
added.
Remember that if you change "Solution Configuration" from Debug to Release you
will need to add the OpenCV libraries to the “Additional Dependencies” again.
12. Hopefully everything went fine, and you can run the project by pressing F5