0
$\begingroup$

Rosanswers logo

Hello,

i want to upgrade opencv version to over 3.4 in Melodic.

Melodic installs opencv 3.2 originally,

so I tried to uninstall opencv 3.2, and re-install opencv 3.4

But some packages which are related to ROS have some problems.

Could you please give any suggestions for tutorials about upgrade opencv version in Melodic?

my Environment are as below

Ubuntu 18.04, Melodic, in Docker Environment.

Thank you all.


Originally posted by danekim on ROS Answers with karma: 3 on 2022-01-13

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Trying to update opencv in ROS is a bad idea. In theory it can be done, but you must now locally build any ROS packages that rely on opencv from their source code, and you have to debug any library changes the opencv devs made. It is a non-trivial amount of work.

It is less work to upgrade to noetic if it is using a version of opencv that is acceptable to you.


Originally posted by Mike Scheutzow with karma: 4903 on 2022-01-15

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by danekim on 2022-01-25:
thx, i decided Do Not Upgrade OpenCv.. it doesn't work with ros related pkgs.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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

Originally posted by Akhil Kurup with karma: 459 on 2022-01-15

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.