import cv2 in ros

asked 2018-08-28 20:29:22 -0600

j.scho gravatar image

updated 2018-08-29 02:45:05 -0600

Hi,

I have installed opencv 3.4.2 from source with CUDA support in my tX2 and i also i have installed ros which include opencv 3.3.1dev I have managed to use the correct opencv version when i use ros with cpp using the CMakeLists but when i try to use opencv in python, the opencv used is the one from ros which i dont want

import cv2 as cv
print cv.__version__
3.3.1dev

I would like to be able to use the opencv which is in the repository:

usr/local/lib/python2.7/dist-packages

I guess python will look directly in the folder of ros which contains the lib (opt/ros/kinetic/lib/python/cv2.so) but i would like to avoid this and link directly to the global one Moreover after symlink the opencv from source to my virtual env, it seems that even the virtual env use the opencv from ros.

Does someone have an idea how to do this?

Thank you

edit retag flag offensive close merge delete

Comments

python2.5

are you really using Python 2.5? All released ROS Python packages target 2.7 at least, so that might complicate this further.

gvdhoorn gravatar imagegvdhoorn ( 2018-08-29 01:41:04 -0600 )edit

my bad. i mistake on python version i use 2.7 as u said but it doesnt change my problem

j.scho gravatar imagej.scho ( 2018-08-29 02:44:53 -0600 )edit

any news? tackling the same..

Gushu gravatar imageGushu ( 2018-11-11 09:16:56 -0600 )edit

No i didnt solve my problem so i just used the opencv from the ROS library. If you find some solution, please let me know

j.scho gravatar imagej.scho ( 2018-11-11 19:36:01 -0600 )edit