Error installing OpenCV on Ubuntu 16.04

拟墨画扇 提交于 2019-12-05 00:55:23
Jose Jaita

I followed the same tutorial for install opencv and I had the same problem. This works for me:

sudo apt-get autoremove libtiff5-dev

sudo apt-get install libtiff5-dev

Enter the opencv directory.

cd build/ (I guess that is already created,otherwise create it)

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..

make

then continue with the tutorial.

According to this, OpenCV needs libtiff4, which Ubuntu has dropped, i.e. the package that replaced it is libtiff5-dev.

As a temporary workaround you can specify -DBUILD_TIFF=ON on cmake when configuring, in order to build the libtiff4 version that is distributed with OpenCV.

This worked for me in Ubuntu 16.04, with OpenCV 3.2.1.

Looks like you need to install/reinstall libpng.

Try make clean ,and then again execute the make command. Generally after one failure if you try the make command without cleaning the earlier installation, you get errors.

I had similar issue. I was building openCV 3.3.0 together with opencv_contrib repository. It turned out that including the flag -D BUILD_TIFF=ON with cmake command resolved the issue as pointed out by gevang already.

Ps.: Since I'm only acknowledging the solution provided by gevang, this should rather a be comment instead of an answer, but I'm missing the corresponding rights. Sorry for that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!