Installation af OpenCV

From Teknologisk videncenter
Revision as of 12:28, 4 November 2014 by JLA (talk | contribs)
Jump to: navigation, search

OpenCV installation på Ubuntu 14.04

Husk at du skal have installleret CUDA inden du starter på denne guide


Updated guide for Ubuntu 14.04:

http://www.sysads.co.uk/2014/05/install-opencv-2-4-9-ubuntu-14-04-13-10/


OLD commands for Ubuntu 12.04:

Kommandoer

sudo apt-get install build-essential cmake pkg-config
Install Image I/O libraries


sudo apt-get install libjpeg62-dev libtiff4-dev libjasper-dev
Install the GTK dev library


sudo apt-get install  libgtk2.0-dev
Install Video I/O libraries


sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
Optional - install video streaming libraries


sudo apt-get install libdc1394-22-dev libxine-dev libgstreamer0.10-dev
    libgstreamer-plugins-base0.10-dev 
Optional - install the Python development environment and the Python Numerical library


sudo apt-get install python-dev python-numpy
Optional - install the parallel code processing library (the Intel tbb library)


sudo apt-get install libtbb-dev
Optional - install the Qt dev library


sudo apt-get install libqt4-dev
Now download OpenCV 2.4.2 to wherever you want to compile the source.


mkdir xxx
cd xxx 
wget <a href="http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.2/OpenCV-2.4.2.tar.bz2">http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.2/Op...</a>
tar -xvf OpenCV-2.4.2.tar.bz2


Opret en mappe med navnet build og konfigurere OpenCV med kommandoen cmake, du må ikke glemme at lave cmake kommandoen

cd OpenCV-2.4.2
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local
-D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON 
-D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON 
-D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
Now compile it


make
And finally install OpenCV 2.4.2


sudo make install