进入安装包中建的build文件夹,执行以下命令:
make uninstall
cd ..
sudo rm -r build
sudo rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*
若提示默写路径没找到,可忽视,第三条命令列举的可能包含opencv路径,存在的路径已经被删除。