Ask Your Question

Revision history [back]

As @Mike Scheutzow said, it is hard to get a different version of opencv working with ROS. But if you wanna try it anyways, this is what I have done in the past:

mkdir ~/opencv && cd ~/opencv
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
cd ~/opencv/opencv
git checkout 3.4.X
cd ~/opencv/opencv_contrib
git checkout 3.4.X

cd ~/opencv/opencv
mkdir build && cd build
cmake -DOPENCV_EXTRA_MODULES_PATH=$HOME/opencv/opencv_contrib/modules -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_opencv_cnn_3dobj=OFF ..
make -j`nproc`
make install