Wednesday, January 20, 2010

OpenCV 2.0 Installation

To install OpenCV 2.0 for Windows:
  • Download OpenCV2.0 for Windows from http://sourceforge.net/projects/opencvlibrary/ . Choose the file named OpenCV-2.0.0a-win32.exe.
  • Install it to the default directory, which is C:\OpenCV2.0
The following screenshots will be displayed when installing OpenCV 2.0 for Windows:










This guide assumes that you already had Microsoft Visual C++ 2008 Professional Edition installed in your computer.

Unlike in the OpenCV 1.0, the installation package of OpenCv 2.0 does not include pre-compiled OpenCV libraries for Visual Studio (Visual C++).
Therefore, after completing the installation of OpenCV 2.0 you need to build the libraries by yourself before using them with Visual C++. You will need CMake to configure OpenCV before you build the libraries using Visual C++ 2008.
CMake can be downloaded from http://www.cmake.org/cmake/resources/software.html and then it should be installed in your computer.
When this guide was written, I used CMake 2.8.0.

After successfully built OpenCV libraries, I got these files that I can use with Visual Studio (C++) 2008 Professional Edition:
In the folder C:\OpenCV2.0\vs2008\lib\Debug:
  • cv.lib
  • cv200d.lib
  • cvaux200d.lib
  • cvhaartraining.lib
  • cxcore200d.lib
  • cxts200d.lib
  • highgui200d.lib
  • ml200d.lib
  • opencv_ffmpeg200d.lib
In the folder C:\OpenCV2.0\vs2008\lib\Release:
  • cv.lib
  • cv200.lib
  • cvaux200.lib
  • cvhaartraining.lib
  • cxcore200.lib
  • cxts200.lib
  • highgui200.lib
  • ml200.lib
  • opencv_ffmpeg200.lib
However, for some unknown reason, the library files in C:\OpenCV2.0\vs2008\lib\Debug do not seem to work properly. When I use them, the application build in Visual C++ could be compiled without errors, but failed to run properly. It always shows the message:
"The application failed to initialize properly (0xc0150002). Click OK to terminate the application."

The library files in C:\OpenCV2.0\vs2008\lib\Release work well though. So I always choose to use the library files in the Release folder instead.

No comments:

Post a Comment