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 .
    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 and Visual 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:
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:

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.

For further queries contact Shrinivasa Naika C.L (see the email address from the Contacts).

Comments are closed.