Ubuntu20.04.1LTS 2020-01-14-Successful


lib Install

apt-get install -y build-essential pkg-config cmake
apt-get install -y libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-dev

Download

github:
git clone https://github.com/opencv/opencv.git

gitee:
git clone https://gitee.com/mirrors/opencv.git

Install

cd opencv

mkdir build

cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_GTK=ON -D OPENCV_GENERATE_PKGCONFIG=YES ..

make -j4

make install

Set

echo "include /usr/loacal/lib" >> /etc/ld.so.conf
ldconfig
echo "PKG_CONFIG_PATH=\$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig" >> /etc/bash.bashrc
echo "export PKG_CONFIG_PATH" >> /etc/bash.bashrc

Show version

pkg-config --modversion opencv4

pkg-config --cflags opencv4

pkg-config --libs opencv4