1. 找到安装Opencv的路径,定位到它的cmake文件夹,例如/usr/lib/x86_64-linux-gnu/cmake/opencv4
2. 在cmakelist.txt中添加如下语句
set(OpenCV_DIR "/usr/lib/x86_64-linux-gnu/cmake/opencv4")
find_package(OpenCV REQUIRED)
1. 找到安装Opencv的路径,定位到它的cmake文件夹,例如/usr/lib/x86_64-linux-gnu/cmake/opencv4
2. 在cmakelist.txt中添加如下语句
set(OpenCV_DIR "/usr/lib/x86_64-linux-gnu/cmake/opencv4")
find_package(OpenCV REQUIRED)