Cluster der kan alt/OpenCV

From Teknologisk videncenter
Jump to: navigation, search

OpenCV

Before you begin to install OpenCV

Install Dependencies

sudo apt-get install build-essential cmake pkg-config -y
sudo apt-get install Image I/O libraries -y
sudo apt-get install libjpeg62-dev libtiff4--dev libjasper-dev -y
sudo apt-get install the GTK dev library -y
sudo apt-get install libgtk2.0-dev -y
sudo apt-get install Video I/O libraries -y
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev -y
sudo apt-get install libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev -y
sudo apt-get install python-dev python-numpy -y
sudo apt-get install libtbb-dev -y
sudo apt-get install libqt4-dev -y

Install OpenCV

Make the OpenCV directory

mkdir /etc/OpenCV/

Change directory to OpenCV and download OpenCV in the directory

cd /etc/OpenCV/
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.2/OpenCV-2.4.2.tar.bz2
tar -xvf OpenCV-2.4.2.tar.bz2

Make the sub-directory build in the OpenCV folder and configure OpenCV with the command cmake.

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 ..

Finally install OpenCV using the make and make install commands

make
sudo make install