OpenCV installation
Ref: https://docs.opencv.org/master/
License: 3-clause BSD License
Dependencies
build-essential, cmake, git, libgtk2.0-dev, pkg-config, libavcodec-dev, libavformat-dev, libswscale-dev를 제외한 나머지는 옵션입니다.
아래 설명에 나오는 패키지를 한 번에 설치하려면 아래 명령어를 실행하시면 됩니다.
wget https://raw.githubusercontent.com/hhk7734/conf/master/opencv/package_install.sh package_install.sh ;\
sleep 1 \
&& sudo chmod +x package_install.sh \
&& ./package_install.sh
Update
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
Python
sudo apt install -y python-dev python3-dev python3-pip \
&& python3 -m pip install -U pip \
&& python3 -m pip install --user numpy
GCC, CMake, git
sudo apt install -y build-essential cmake git
GUI, GL
sudo apt install -y libgtk2.0-dev libgtk-3-dev libqt4-dev \
&& sudo apt install -y mesa-utils libgl1-mesa-dri libqt4-opengl-dev
pkg-config
sudo apt install -y pkg-config
FFmpeg
sudo apt install -y libavcodec-dev libavformat-dev libswscale-dev
parallelism
sudo apt install -y libtbb2 libtbb-dev
Image codec
sudo apt install -y libjasper-dev ;\
sudo apt install -y libjpeg-dev libtiff5-dev \
&& sudo apt install -y libpng12-dev || sudo apt install -y libpng-dev
libjasper-dev 설치를 실패한 경우, https://github.com/mdadams/jasper
설치하지 않고 넘어가면, OpenCV가 빌드될 때 빌드됩니다.
Video codec
sudo apt install -y libxvidcore-dev \
&& sudo apt install -y libx264-dev \
&& sudo apt install -y libxine2-dev \
&& sudo apt install -y libv4l-dev v4l-utils
Streaming
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
IEEE 1394 digital camera
sudo apt install -y libdc1394-22-dev
Mathmatic
sudo apt install -y gfortran libatlas-base-dev libeigen3-dev libhdf5-serial-dev