-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
66 lines (65 loc) · 2.18 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM python:3.7
MAINTAINER Eko Rudiawan <eko.rudiawan@gmail.com>
RUN apt-get update
# For compile
RUN apt-get install -y build-essential
RUN apt-get install -y cmake
RUN apt-get install -y git
RUN apt-get install -y pkg-config
RUN apt-get install -y wget
RUN apt-get install -y unzip
# OpenCV Require
RUN apt-get install -y libjpeg-dev
RUN apt-get install -y libtiff-dev
RUN apt-get install -y libpng-dev
# RUN apt-get install -y libjasper-dev
# Video
RUN apt-get install -y libavcodec-dev
RUN apt-get install -y libavformat-dev
RUN apt-get install -y libswscale-dev
RUN apt-get install -y libv4l-dev
# GUI
RUN apt-get install -y libgtk2.0-dev
# Optimization
RUN apt-get install -y libatlas-base-dev gfortran
# Python Libraries
RUN pip install numpy
RUN pip install matplotlib
RUN pip install scipy
# Lokasi install di home
WORKDIR /home/
# Versi OpenCV
ENV OPENCV_VERSION="3.4.6"
# RUN cd $WORKDIR$
RUN git clone -b 3.4 https://github.com/ekorudiawan/opencv.git
# OpenCV Contrib
RUN wget https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip \
&& unzip ${OPENCV_VERSION}.zip
RUN rm -rf ${OPENCV_VERSION}.zip
RUN mv opencv opencv-${OPENCV_VERSION}
RUN mkdir opencv-${OPENCV_VERSION}/cmake_binary
RUN cd /home/opencv-${OPENCV_VERSION}/cmake_binary \
# Build OpenCV
&& cmake -DBUILD_TIFF=ON \
-DBUILD_opencv_java=OFF \
-DOPENCV_EXTRA_MODULES_PATH=/home/opencv_contrib-${OPENCV_VERSION}/modules \
-DWITH_CUDA=OFF \
-DWITH_OPENGL=ON \
-DWITH_OPENCL=ON \
-DWITH_IPP=ON \
-DWITH_TBB=ON \
-DWITH_EIGEN=ON \
-DWITH_V4L=ON \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=$(python3.7 -c "import sys; print(sys.prefix)") \
-DPYTHON_EXECUTABLE=$(which python3.7) \
-DPYTHON_INCLUDE_DIR=$(python3.7 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-DPYTHON_PACKAGES_PATH=$(python3.7 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
.. \
&& make -j8 install
RUN rm -rf /home/opencv-${OPENCV_VERSION} \
rm -rf /home/opencv_contrib-${OPENCV_VERSION}
COPY . .
CMD ["python","./sources/cross-arm-hough-transform.py"]