12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- # Ubuntu20.04
- FROM ros:noetic
- RUN apt-get update
- RUN apt-get install -y iputils-ping unzip
- COPY ./setup.bash ./setup.bash
- RUN echo "source ./setup.bash" >> /root/.bashrc
- RUN echo "source /opt/ros/noetic/setup.bash" >> /root/.bashrc
- #RUN echo "Install OpenCV v4.2.0:" \
- # && set -x \
- # && apt-get update \
- # && apt-get install -y libopencv-dev python3-opencv \
- # && python3 -c "import cv2; print(cv2.__version__)"
- RUN echo "Install OpenCV v4.5.3 Dependencies:" \
- && set -x \
- && apt-get update \
- && apt-get install -y cmake build-essential pkg-config ant \
- && apt-get install -y libtiff5-dev libopenexr-dev libwebp-dev libpng-dev \
- && apt-get install -y libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libavresample-dev libv4l-dev \
- && apt-get install -y libgtk-3-dev \
- && apt-get install -y libtesseract-dev \
- && apt-get install -y libhdf5-dev \
- && apt-get install -y libopenblas-dev libopenblas-base liblapacke-dev \
- && apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
- && apt-get install -y libtbb-dev \
- && apt-get install -y python-numpy \
- && echo "End."
- COPY ./download/opencv-v4.5.3.zip /opt/opencv-v4.5.3.zip
- COPY ./download/opencv-contrib-v4.5.3.zip /opt/opencv-contrib-v4.5.3.zip
- RUN echo "Install OpenCV v4.5.3:" \
- && set -x \
- && unzip -o /opt/opencv-v4.5.3.zip -d /opt/ \
- && rm -f /opt/opencv-v4.5.3.zip \
- && unzip -o /opt/opencv-contrib-v4.5.3.zip -d /opt/ \
- && rm -f /opt/opencv-contrib-v4.5.3.zip \
- && sed -i '56a\\ /usr/include/aarch64-linux-gnu' /opt/opencv/cmake/OpenCVFindOpenBLAS.cmake \
- && sed -i '73a\\ /usr/lib/aarch64-linux-gnu' /opt/opencv/cmake/OpenCVFindOpenBLAS.cmake \
- && cat /opt/opencv/cmake/OpenCVFindOpenBLAS.cmake \
- && cd /opt/opencv \
- && mkdir build \
- && cd build \
- && cmake -D CMAKE_BUILD_TYPE=RELEASE \
- -D CMAKE_INSTALL_PREFIX=/usr/local \
- -D WITH_CUDA=OFF \
- -D INSTALL_PYTHON_EXAMPLES=ON \
- -D INSTALL_C_EXAMPLES=OFF \
- -D OPENCV_EXTRA_MODULES_PATH=/opt/opencv_contrib/modules \
- -D PYTHON_EXECUTABLE=/usr/bin/python \
- -D BUILD_opencv_python3=ON \
- -D PYTHON3_EXECUTABLE=/usr/bin/python3.6 \
- -D WITH_GSTREAMER=ON \
- -D WITH_TBB=ON \
- -D WITH_LIBV4L=ON .. \
- -D OPENCV_ENABLE_NONFREE=ON \
- -D WITH_PROTOBUF=ON \
- -D BUILD_EXAMPLES=ON .. \
- && make -j $(nproc) \
- && make install \
- && ldconfig \
- && echo "End."
|