OpenCV 4 has been released for some time. I tried to install CentOS 7.6 successfully and shared it with netizens.
Installation dependencies
yum install gcc gcc-c++
yum install cmake3
yum install gtk2-devel
yum install ant
Download the OpenCV source code
链接:https://pan.baidu.com/s/1KvamVkoqOmv3G_I5vATWzA
提取码:xkzg
installation
First unzip the downloaded zip file.
cd /usr/local/
unzip opencv-4.1.0.zip
cd /usr/local/opencv-4.1.0/
Enter the root directory after decompression:
1、mkdir build
2、cd build
3、cmake3 -D BUILD_SHARED_LIBS=OFF -D BUILD_TESTS=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/home/opencv/ .. (/home/opencv/可以任意更改成想要的位置)
4、make (关键步骤,如果没有任何错误,将看到如下结果)