1-首先安装opencv 依赖的类库:
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libtiff4-dev cmake libswscale-dev libjasper-dev
否则,在opencv安装后,即使编译没问题,但是运行也会出错。
2- 安装opencv库:
sudo apt-get install libopencv-dev
至此,opencv库就算安装好了。