Sunteți pe pagina 1din 2

OpenCV 2.3.

1 installation guide for Window 7 and VS 2010


professional (Express)
Follow these steps to install OpenCV 2.3.1
1.

Download the OpenCV-2.3.1-win-superpack.exe from the given


link http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.3.1/ .
to any directory.
2.
Once the package is downloaded (pre-build binary i.e. no need of cmake build) to
any directory e.g., D directory. Select the package and right click and choose Run as
administrator.
3.

An Extract window will pop up as shown in the figure above. Enter C:\ and click
the Extract button . You can select whichever drive/directory you wish to. Here C:\
assumed default directory.
4.
A folder by name opencv will now be created in the C:\ directory.
5.
Add C:\opencv\build\x86\vc10\bin by going to Computer (right
click)->properties->Advanced-System settings->Advanced>Environment variable , System variables-> PATH as show in the figure
below and restart the system.
6.
Open Visual Studio 2010 Professional (or Express) and select File->new
project andVisual C++ and Win32Console Application as shown in figure
below.
7.
Enter the name of the project and click OK. In the application setting
select Console application and Empty project as shown in figure.
8.
Click Finish , then select the project and add a .cpp file as shown in figure below
E.g. test.cpp.
9.
Click Add and type the code as shown in figure to display a figure. In addition,
you will observe that the red underlined code also appears. (This is because we did
not set the project properties as yet).
10.
Open Project->properties, select Active(debug), Active(win32) (note by
default they will be selected), and press Configurationproperties , select VC++
directories for Include
Directories (type/select)C:\opencv\build\include\opencv;
C:\opencv\build\include; opencv is for C type declaration where as opencv2 is

for C++ wrappers, so both should be included as shown in figure. For Library
Directories select C:\opencv\build\x86\vc10\lib;
Next Select Linker ->input option and in Additional dependencies (edit) paste
the following files:
opencv_calib3d231d.lib
opencv_contrib231d.lib
opencv_core231d.lib
opencv_features2d231d.lib
opencv_flann231d.lib
opencv_gpu231d.lib
opencv_haartraining_engined.lib
opencv_highgui231d.lib
opencv_imgproc231d.lib
opencv_legacy231d.lib
opencv_ml231d.lib
opencv_objdetect231d.lib
opencv_ts231d.lib
opencv_video231d.lib
For Active (Release) paste the file names above removing the alphabet d before
.lib in the file name and click OK.
Build the project and run.
In case an error tbb_debug.dll not found is flagged then:
Download the tbb zip from the link:
http://threadingbuildingblocks.org/uploads/78/174/4.0/tbb40_233oss_win.zip
Extract the zip file and open ..\tbb40_20111130oss\bin\ia32\vc10 and search for
tbb_debug.dll. Copy and paste it in C:\opencv\build\x86\vc10\bin then run
the program.

S-ar putea să vă placă și