Browse Source

opencv update

pull/16/head
Johannes Schickling 9 years ago
parent
commit
52d860101f
  1. 34
      opencv/Dockerfile
  2. 32
      opencv/install.sh

34
opencv/Dockerfile

@ -1,8 +1,36 @@
FROM debian:wheezy
FROM debian:jessie
MAINTAINER Johannes Schickling "schickling.j@gmail.com"
ADD install.sh install.sh
RUN chmod +x install.sh && ./install.sh && rm install.sh
ARG OPENCV_VERISON="3.0.0"
# install dependencies
RUN apt-get update
RUN apt-get install -y libopencv-dev yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils pkg-config
RUN apt-get install -y curl build-essential checkinstall cmake
# download opencv
RUN curl -sL https://github.com/Itseez/opencv/archive/$OPENCV_VERISON.tar.gz | tar xvz -C /tmp
RUN mkdir -p /tmp/opencv-$OPENCV_VERISON/build
WORKDIR /tmp/opencv-$OPENCV_VERISON/build
# install
RUN cmake -DWITH_FFMPEG=OFF -DWITH_OPENEXR=OFF -DBUILD_TIFF=OFF -DWITH_CUDA=OFF -DWITH_NVCUVID=OFF -DBUILD_PNG=OFF ..
RUN make
RUN make install
# configure
RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf
RUN ldconfig
RUN ln /dev/null /dev/raw1394 # hide warning - http://stackoverflow.com/questions/12689304/ctypes-error-libdc1394-error-failed-to-initialize-libdc1394
# cleanup package manager
RUN apt-get remove --purge -y curl build-essential checkinstall cmake
RUN apt-get autoclean && apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# prepare dir
RUN mkdir /source
VOLUME ["/source"]
WORKDIR /source

32
opencv/install.sh

@ -1,32 +0,0 @@
#! /bin/bash
# exit if a command fails
set -e
opencv_version="2.4.10.1"
opencv_deps=(libopencv-dev yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg pkg-config)
install_deps=(curl build-essential checkinstall cmake)
# install dependencies
apt-get update && apt-get install -y ${install_deps[@]} ${opencv_deps[@]}
# download opencv
curl -sL https://github.com/Itseez/opencv/archive/$opencv_version.tar.gz | tar xvz -C /tmp
# install
cd /tmp/opencv-$opencv_version && mkdir build && cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_OPENGL=ON ..
make
make install
# configure
echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf
ldconfig
ln /dev/null /dev/raw1394 # hide warning - http://stackoverflow.com/questions/12689304/ctypes-error-libdc1394-error-failed-to-initialize-libdc1394
# cleanup package manager
apt-get remove --purge -y ${install_deps[@]} && apt-get autoclean && apt-get clean
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# prepare dir
mkdir /source
Loading…
Cancel
Save