Ask Your Question
0

How to build OpenCV 4.1.0 on Ubuntu 18.10

asked 2019-05-28 16:35:27 -0500

Any chance someone has a tutorial newer than the nine year old instructions on Ubuntu 10.0 here: https://docs.opencv.org/4.1.0/d7/d9f/...

I've been attempting to build from source, and while I'm close, there are still some problems I don't know how to solve. For example, once built and installed, I end up with the include files installed in the directory /usr/include/opencv4/opencv2/... which obviously is not correct.

This is how I've been attempting to build on Ubuntu 18.10:

unzip opencv-4.1.0.zip
unzip opencv_contrib-4.1.0.zip
cd opencv-4.1.0
mkdir build
cd build
cmake \
  -DCPACK_BINARY_DEB=ON \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=/usr/local \
  -DOPENCV_GENERATE_PKGCONFIG=ON \
  -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.1.0/modules \
  -DEXTRA_MODULES_VCSVERSION=4.1.0 \
  -DOPENCV_VCSVERSION=4.1.0 \
  -DWITH_TBB=ON \
  -DWITH_IPP=ON \
  -DWITH_CUDA=OFF \
  -DWITH_OPENCL=ON \
  -DWITH_LIBV4L=ON \
  -DWITH_OPENMP=ON \
  -DWITH_NVCUVID=OFF \
  -DWITH_CSTRIPES=ON \
  -DWITH_GSTREAMER=ON \
  -DBUILD_opencv_python2=ON \
  -DBUILD_opencv_python3=ON \
  -DBUILD_PERF_TESTS=OFF \
  -DBUILD_EXAMPLES=OFF \
  -DBUILD_TESTS=OFF \
  -DBUILD_DOCS=ON \
  ..
make -j16
sudo make install
cpack -G DEB
sudo make uninstall
sudo dpkg -i OpenCV-4.1.0-x86_64-*.deb
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2019-05-29 05:00:30 -0500

berak gravatar image

updated 2019-05-29 05:01:46 -0500

I end up with the include files installed in the directory /usr/include/opencv4/opencv2/... which obviously is not correct.

it is the correct path (on ubuntu) ;(

(a recent change in the opencv4 branch. the libs are still in /usr/lib by default)

edit flag offensive delete link more

Comments

1

That is very messed up. I hope that is a bug, and not a decision that was made. Even the most trivial OpenCV applications and examples no longer compile in OpenCV v4 due to the opencv2 directory being within opencv4.

Stéphane Charette gravatar imageStéphane Charette ( 2019-06-10 19:51:28 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-05-28 16:35:27 -0500

Seen: 169 times

Last updated: May 29