Hangvirus Search
Loading
Windows
Install OpenCV
Download OpenCV installer and install it. I assume you have installed onto C:\Program Files\OpenCV.
It is being assumed that you know the usage of Microsoft Visual C++, such as creating projects and their properties.
It is being assumed that you know the usage of Microsoft Visual C++, such as creating projects and their properties.
MS Visual C++
Setup MS Visual C++
I write details based on MS Visual Studio 2005. Follow menus of MS Visual C++ window as:
- Tools > Options > Projects and Solutions > VC++ directories >
- Show Directory for: > Include Files. Now add
C:\Program Files\OpenCV\cv\include C:\Program Files\OpenCV\cvaux\include C:\Program Files\OpenCV\cxcore\include C:\Program Files\OpenCV\otherlibs\highgui C:\Program Files\OpenCV\ml\include C:\Program Files\OpenCV\otherlibs\cvcam\include
- Show Directory for: > Library Files. Now add
C:\Program Files\OpenCV\lib
- (Option) Show Directory for: > Source Files. Now add
C:\Program Files\OpenCV\cv\src C:\Program Files\OpenCV\cvaux\src C:\Program Files\OpenCV\cxcore\src C:\Program Files\OpenCV\otherlibs\highgui C:\Program Files\OpenCV\otherlibs\cvcam\src\windows
Setup MS Visual C++ for each project
- Right Click Project > Property >
- Configuration Proeperties > Linker > Input > Additional Dependencies. Now add
- cv.lib cxcore.lib cvaux.lib highgui.lib ml.lib cvcam.lib
- Change 'Configuration' drop down menu from Release (Debug) to Debug (Release).
- Do the same thing (Add .libs to Input)
Or, add below codes into your source codes above #include(s).
#ifdef _MSC_VER #pragma comment(lib, "cv.lib") #pragma comment(lib, "cxcore.lib") #pragma comment(lib, "cvaux.lib") #pragma comment(lib, "highgui.lib") #pragma comment(lib, "ml.lib") #pragma comment(lib, "cvcam.lib") #endif
Examples
For examples see the opnecv samples in the the folder created during setup.
Try them on the Microsoft Visual C++ 2008 projects.
0 comments to "Installation of Opencv in MS - Visual C++"
Post a Comment