ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

upgrade opencv version in melodic

asked 2022-01-13 19:15:34 -0500

danekim gravatar image

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.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2022-01-15 09:48:03 -0500

Mike Scheutzow gravatar image

updated 2022-01-15 09:52:16 -0500

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.

edit flag offensive delete link more

Comments

thx, i decided Do Not Upgrade OpenCv.. it doesn't work with ros related pkgs.

danekim gravatar image danekim  ( 2022-01-25 01:41:38 -0500 )edit
1

answered 2022-01-15 10:38:22 -0500

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
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-01-13 19:15:34 -0500

Seen: 1,701 times

Last updated: Jan 15 '22