Showing posts with label OpenCV. Show all posts
Showing posts with label OpenCV. Show all posts

Wednesday, July 26, 2017

Building OpenCV from Source


Prerequisites

sudo apt-get -y update
sudo apt-get -y upgrade

echo "Installing build tools"
sudo apt-get -y install build-essential cmake pkg-config

echo "Installing GUI libraries and OpenGL extensions"
if [ $WITH_QT -ne 0 ]; then
  sudo apt-get -y install libqt4-dev
  sudo apt-get -y install libqt4-opengl-dev
else
  sudo apt-get -y install libgtk2.0-dev
  sudo apt-get -y install libgtkglext1 libgtkglext1-dev
fi

echo "Installing Python libraries"
sudo apt-get -y install python-dev python-numpy
sudo apt-get -y install python-scipy

echo "Installing media I/O libraries"
sudo apt-get -y install libpng12-0 libpng12-dev libpng++-dev libpng3
sudo apt-get -y install libpnglite-dev libpngwriter0-dev libpngwriter0c2
sudo apt-get -y install zlib1g zlib1g-dbg zlib1g-dev
sudo apt-get -y install pngtools
sudo apt-get -y install libjasper1 libjasper-dev libjasper-runtime
sudo apt-get -y install libjpeg8 libjpeg8-dbg libjpeg8-dev libjpeg-progs
sudo apt-get -y install libtiff4-dev libtiff4 libtiffxx0c2 libtiff-tools
sudo apt-get -y install openexr libopenexr-dev libopenexr6

echo "Installing video I/O libraries"
sudo apt-get -y install libavcodec53 libavcodec-dev libavformat53 libavformat-dev libavutil51 libavutil-dev
sudo apt-get -y install libswscale2 libswscale-dev
sudo apt-get -y install libgstreamer0.10-0-dbg libgstreamer0.10-0 libgstreamer0.10-dev
sudo apt-get -y install libxine1-ffmpeg libxine-dev libxine1-bin
sudo apt-get -y install libunicap2 libunicap2-dev
sudo apt-get -y install libdc1394-22 libdc1394-22-dev libdc1394-utils

echo "Installing codecs"
sudo apt-get -y install libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev
sudo apt-get -y install ffmpeg x264 libx264-dev libv4l-0 libv4l v4l-utils

echo "Installing multiprocessing libraries"
sudo apt-get -y install libtbb-dev


 diffstat docutils-common libavcodec-dev libavformat-dev libavutil-dev libblas-dev libdc1394-22-dev libilmbase-dev libjasper-dev libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev libjs-sphinxdoc liblapack-dev
  libopenexr-dev libraw1394-dev libswscale-dev libtiff4-dev libtiffxx0c2 libv4l-dev python-docutils python-jinja2 python-roman python-sphinx python-support quilt sphinx-common swig swig2.0
  texlive-fonts-extra texlive-fonts-recommended
 


Build Documents

you should install
texlive, texlive-latex-extra, texlive-fonts-extra texlive-fonts-recommended
python-sphinx
dvipng
for building documents. These are for mathematical expression using Latex and .rst file manipulation

Sunday, February 01, 2015

Building OpenCV for Android from Source

Reference

Introduction

  1. Check Android Version
    1. Most of Example does not run completely on Lollipop because native camera are not supported by OpenCV 2.4.10.  libnative_camera_r5.0.0.so does not exist yet.
  2. Download Android source code and compile it 
    1. For full build including "OpenCV Manager(or Engine)" android platform source tree is needed. Check my previous post (http://jylee-world.blogspot.kr/2013/11/android-platform-nexus-4-rooting.html)
    2. We get opencv_engine.apk(including libOpenCVEngine.so and libOpenCVEngine_jni.so) by setting source tree.
  3. Download android NDK and set ANDROID_NDK
  4. Download android SDK and set ANDROID_SDK
  5. Setup for cmake (explained in detail in the next sections)
    1. Modify cmake_android_arm.sh
    2. Combine cmake_android_service.sh)
  6. Apply minor source modifications (explained in detail in the next sections)
  7. cmake
  8. make
 I use opencv-2.4.10-release, android-ndk-r9d(NDK),  adt-bundle-linux-x86_64-20140702(SDK), android-4.4.2_r1 (Android Source)