Friday, October 3, 2014

Installing OpenCV in Linux

Install dependecies:

$sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev

$mkdir OpenCV
$cd OpenCV
$git clone https://github.com/Itseez/opencv.git
$cmake CMakeLists.txt
$make
$sudo make install


Make a file under /etc.ld.so.conf.d folder. Name it opencv.conf
Write /usr/local/lib/ and save the file.

$sudo gedit /etc/ld.so.conf.d/opencv.conf
$sudo ldconfig -v

Set the system variables:

$export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
$sudo ldconfig

$export LD_LIBRARY_PATH=~/opencv/OpenCV-2.0.3/release/:$LD_LIBRARY_PATH
$sudo ldconfig

$sudo gedit /etc/bash.bashrc

Type this to the last line of bash.bashrc:

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH



No comments:

Post a Comment

Setting Jupyter and Tensorflow on Google Cloud Platform

https://towardsdatascience.com/running-jupyter-notebook-in-google-cloud-platform-in-15-min-61e16da34d52