Beruflich Dokumente
Kultur Dokumente
1 of 4
http://opencv.willowgarage.com/wiki/VisualC++_VS2008
http://www.youtube.com/watch?v=9nPpa_WiArI
Install OpenCV
1.
2. Install it to a folder (without any spaces in it), say "C:\OpenCV2.1\". This article will refer to this path as $openCVDir
3. During installation, enable the option "Add OpenCV to the system PATH for all users".
21/09/2012 19:32
2 of 4
http://opencv.willowgarage.com/wiki/VisualC++_VS2008
Now choose Include files in the list box, and locate and add the following directories:
"C:\OpenCV1.0\cv\include"
"C:\OpenCV1.0\cxcore\include"
"C:\OpenCV1.0\otherlibs\highgui"
"C:\OpenCV1.0\cvaux\include"
"C:\OpenCV1.0\otherlibs\_graphics\include"
Next, choose source files in the list box, and locate and add the following directories:
"C:\OpenCV1.0\cv\src"
"C:\OpenCV1.0\cxcore\src"
"C:\OpenCV1.0\cvaux\src"
"C:\OpenCV1.0\otherlibs\highgui"
"C:\OpenCV1.0\otherlibs\_graphics\src"
21/09/2012 19:32
3 of 4
http://opencv.willowgarage.com/wiki/VisualC++_VS2008
After the above steps done Developer Studio will create the project folder (by default it has the same name as the project), <project
name>.vcproj file, Solution <project name>.sln and, Three Source files: <project name>.cpp, stdafx.cpp and stdafx.h. StdAfx files are
precompiled header files, which can be very useful if you want to reduce the compilation time.
For example, consider that we have created a new "Hello" Project. Open the Hello.cpp file, and include the OpenCV-related #include directives:
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
Note that these should be included after stdafx.h or you may get build errors.
Now Type some OpenCV code, and Build the Solution by pressing the F7 Key. There should be linker errors.
Add dependency projects into workspace
Choose from menu: "Project" -> "Properties".
Choose "Linker" tab -> "Input" category -> "Additional Dependencies:". Add the paths to all necessary import libraries (cxcore[d].lib cv[d].lib
highgui[d].lib cvaux[d].lib cvcam[d].lib)
Note: The debug versions are available only when you Build the Visual C++ .NET solution provided with the OpenCV installation.
21/09/2012 19:32
4 of 4
http://opencv.willowgarage.com/wiki/VisualC++_VS2008
If the build process complains about a missing 'windows.h' header file, then you'll need to install the latest version of the
SDK.
. That's it!.. Now Build and Run the application using F5 key and enjoy OpenCV!
Microsoft Windows
.
If you have any queries regarding this, try posting at
.
All the Best!
Paramesh.
Modified by Seongjoo 2008-06-13
21/09/2012 19:32