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

how to use the vision_opencv on python script?

asked 2015-05-10 02:43:18 -0500

anthuny shin gravatar image

hello,

i want to use the vision_script on python script.

can you show me the example?

and how configurate the cmakelist.txt?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-05-10 16:31:35 -0500

Mehdi. gravatar image

updated 2015-05-12 03:37:48 -0500

For Python you don't really need to configure CMakeLists.txt

You could just use opencv directly in Python by including it as follows:

import cv2

Then use all opencv algorithms accessible under the namespace cv2 (cv2.imshow() for example). You should of course have opencv installed on your computer.

For converting between OpenCV image format and ROS images check this tutorial

edit flag offensive delete link more

Comments

I add 'import opencv2 as cv2', but is not work. it's occur the error ' no module named opencv2.

how to solve?

anthuny shin gravatar image anthuny shin  ( 2015-05-10 20:39:14 -0500 )edit

Sorry my mistake, I edited the code. Normally all should work fine if you installed opencv from the debs using sudo apt-get install libopencv-dev

Mehdi. gravatar image Mehdi.  ( 2015-05-12 03:38:43 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-05-10 02:43:18 -0500

Seen: 116 times

Last updated: May 12 '15