Installing OpenCV 2.4 on Debian Wheezy

C├ędric SILEO, Software Engineer

August 28th, 2014

Installation

export TMPDOWNLOAD=/tmp apt-get install build-essential cmake pkg-config libgtk2.0-dev python-dev python-numpy libpng12-0 libpng12-dev libpng++-dev libpng3 libpnglite-dev zlib1g-dbg zlib1g zlib1g-dev pngtools libjasper-dev libjasper-runtime libjasper1 libjpeg8 libjpeg8-dbg libjpeg62 libjpeg8-dev libjpeg-progs libtiff4-dev libtiff4 libtiffxx0c2 libtiff-tools ffmpeg libavcodec-dev libavcodec53 libavformat53 libavformat-dev libswscale2 libswscale-dev openexr libopenexr6 libopenexr-dev libgstreamer0.10-0-dbg libgstreamer0.10-0 libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libxine1-ffmpeg libxine-dev libxine1-bin libunicap2 libunicap2-dev libdc1394-22-dev libdc1394-22 libdc1394-utils libv4l-0 libv4l-dev wget -P $TMPDOWNLOAD https://github.com/Itseez/opencv/archive/2.4.5.tar.gz tar -xvzf $TMPDOWNLOAD/2.4.5.tar.gz -C /usr/local/lib/ mkdir /usr/local/lib/opencv-2.4.5/release cd /usr/local/lib/opencv-2.4.5/release cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_V4L=ON -D WITH_GSTREAMER=ON -D WITH_OPENEXR=ON -D WITH_UNICAP=ON -D BUILD_PYTHON_SUPPORT=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON .. # This may take a while: make ln -s opencv-2.4.5/release/lib /usr/local/lib/opencv chmod -R a+r /usr/local/lib/opencv-2.4.5/ find /usr/local/lib/opencv-2.4.5/ -perm /a=x -exec chmod a+rx {} \;

Usage

export PYTHONPATH=/usr/local/lib/opencv:$PYTHONPATH python your_opencv2.4_program.py

Thanks to

http://indranilsinharoy.com/2012/11/01/installing-opencv-on-linux/