參考資訊:
https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html
步驟如下:
$ sudo apt-get install build-essential -y $ sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev -y $ sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff5-dev libdc1394-22-dev -y $ cd $ wget https://github.com/opencv/opencv/archive/4.3.0.zip $ unzip 4.3.0.zip $ mkdir -p opencv-4.3.0/build $ cd opencv-4.3.0/build $ cmake .. $ make -j4 $ sudo make install $ cd $ wget https://github.com/opencv/opencv_contrib/archive/4.3.0.tar.gz $ tar xvf 4.3.0.tar.gz $ mkdir opencv_contrib-4.3.0/build $ cd opencv_contrib-4.3.0/build $ cmake -DOPENCV_EXTRA_MODULES_PATH=../modules ../../opencv-4.3.0 $ make -j4 $ sudo make install