查看OpenCV版本
pkg-config --modversion opencv
OpenCV的卸载
找到当初安装 OpenCV的 build 目录,进入 build 目录
sudo make uninstall cd .. sudo rm -r build
CMake指定OpenCV版本
方案1.指定include的路径
set(OpenCV_INCLUDE_DIRS "/usr/local/include")
方案2.指定OpenCV所在的路径
SET(OpenCV_DIR "/usr/local/share/opencv4/") find_package(OpenCV 4.5.0 REQUIRED)