Göm meny

OpenCV Installation Windows

Cmake

Cmake is a cross-platform, open-source build system.

Download and install the latest stable binary version:

http://www.cmake.org/files/v2.8/cmake-2.8.8-win32-x86.exe

JRE

Java run time environment is needed for Eclipse to work.

Download and install it:

http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1637588.html

Eclipse

Download Eclipse IDE for C/C++ Developers:

http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/junor

Installation instructions:

http://wiki.eclipse.org/Eclipse/Installation

Doxygen (optional)

Follow these instructions to install Doxygen for use in Eclipse

http://code.google.com/p/tonatiuh/wiki/InstallingDoxygenForWindows

Python

Download and install the scientific-oriented Python Distribution Python(x,y):

http://ftp.ntua.gr/pub/devel/pythonxy/Python(x,y)-2.7.2.3.exe

This distribution contains the MinGW compiler toolchain, which will be used by Cmake and Eclipse.

Download and install the OpenCV plugin update as well:

http://pythonxy.googlecode.com/files/OpenCV-2.4.2_py27.exe

TBB (Optional)

Intel © Threading Building Blocks ( TBB ) download the source files:

http://threadingbuildingblocks.org/uploads/77/187/4.0%20update%205/tbb40_20120613oss_src.tgz

Extract it inside a directory likeC:\TBB\tbb40_20120613oss

Open a shell ( Start -> type 'cmd' in the Search programs and files field )

Navigate to the top-level directory of the TBB library, and build it:

make compiler=gcc arch=ia32

Add a system environment variable TBBDIR : C:\TBB\tbb40_20120613oss

Add %TBBDIR%\build\windows_ia32_gcc_mingw4.5.2_release to the system PATH

Eigen (Optional)

Eigen is a C++ template library for linear algebra.

http://bitbucket.org/eigen/eigen/get/3.1.1.zip

Extract it into a directory like C:\Eigen\eigen-eigen-43d9075b23ef

No need to build anything.

Qt (Optional)

Download the Qt library source:

http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.2.zip

Extract it into a directory like C:\Qt

Open a shell, cd to the directory containing the extracted Qt files and enter the following command:

configure.exe -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools
              -no-qt3support -no-multimedia -no-ltcg

This will take around 10 minutes. Then enter the next command that will take a lot longer (can easily take even more than a full hour):

make

Create a system environment variable QTDIR : C:\Qt\qt-everywhere-opensource-src-4.8.2

Add %QTDIR%\bin at the front of the system PATH.

MikTeX (Optional)

MikTeX is needed for building the documentation.

OpenCV

Download OpenCV:

http://sourceforge.net/projects/opencvlibrary/files/latest/download

Extract it into a directory like C:\OpenCV\OpenCV-2.4.2

Start the Cmake GUI (cmake-gui) and select the directory for the source files of the OpenCV library (C:/OpenCV/opencv-2.4.2) and specify a directory where you will build the binary files (C:/OpenCV/opencv-build)

Press the Configure button to specify the compiler (and IDE) you want to use, choose:

Eclipse CDT4 - MinGW Makefiles

Click the Configure button. Check that EIGEN_INCLUDE_PATH, CMAKE_SH has correct paths, and that WITH_CUBLAS, WITH_CUDA, WITH_CUFFT, WITH_OPENEXR are unselected.

Check that ENABLE_SOLUTION_FOLDERS, WITH_QT and WITH_TBB are selected.

Click the Configure button again, and then (when all entries are ok) click the Generate button.

Build OpenCV

Start the Eclipse IDE, and load the generated eclips project:

File -> import -> General -> Existing projects into workspace

Select root directory: C:\OpenCV\opencv-build

Open the workbench, and click on the OpenCV-Release@opencv-build in the Project Explorer

Start the build: Project -> Build Project

Now all binaries and dll's should be available in C:\OpenCV\opencv-build\bin

Install: Project -> Make Target -> Build ...   and select ':install' in the list (at the bottom)

Click the Build button.

Create a system environment variable OPENCV_DIR : C:\OpenCV\opencv-build\install

Add %OPENCV_DIR%\bin to the system PATH.

Now check that the installation works: start the contours.exe example program.


Senast uppdaterad: 2014-03-18