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

How to start using OpenCV and ROS

asked 2016-05-10 02:19:09 -0500

Astronaut gravatar image

updated 2016-05-16 06:32:14 -0500

Airuno2L gravatar image

Hi

Im new in OpenCV and would like to learn using it with ROS fuerte. I am using Ubuntu 12 and 14 and ROS fuerte and Microsoft Kinect. Any good tutorial to start install OpenCV in ROS and start using it with some basic functions to hit the ground? Any help would really appreciate

EDIT: Do I need to change my CmakeList.txt file ? I found that I you need to include it into my CMakeList.txt (here i mean the CMakeList.txt in my package):

find_package(OpenCV REQUIRED)

target_link_libaries(your_node ${OpenCV_LIBS})

True?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-05-10 04:03:51 -0500

Mehdi. gravatar image
 sudo apt-get install libopencv-dev

Then I would suggest using python first. All you need to do is to import opencv in the top of your python script.

import cv2

and then do whatever you want. Opencv functions can be called in ROS callbacks. Most interesting thing would be probably converting ROS image messages to opencv format as explained here. This would allow applying image processing algorithms implemented in opencv on the images you get from ROS.

edit flag offensive delete link more

Comments

Thanks. Im not familiar with python actually. is any option for using C++?

Astronaut gravatar image Astronaut  ( 2016-05-10 19:23:52 -0500 )edit

Yes, you can use OpenCV with C++. Installing it is done the same way.

Airuno2L gravatar image Airuno2L  ( 2016-05-11 05:56:16 -0500 )edit

Here is an example to publish webcam images using opencv and ros

Mehdi. gravatar image Mehdi.  ( 2016-05-11 06:11:38 -0500 )edit

Thanks,. I followed the example. when tried to run make I got the following error: /usr/bin/ld: cannot find -lcv_bridge

I already installed before the cv_bridge package. Should I modify my CmakeList as well?Any help?

Astronaut gravatar image Astronaut  ( 2016-05-12 03:52:52 -0500 )edit

you run make or catkin_make ?

Mehdi. gravatar image Mehdi.  ( 2016-05-12 04:24:15 -0500 )edit

I am using rosbuild. So I run make

Astronaut gravatar image Astronaut  ( 2016-05-12 04:29:00 -0500 )edit

rosmake + package_name

Mehdi. gravatar image Mehdi.  ( 2016-05-12 04:50:21 -0500 )edit

No. It does not work. error again

Astronaut gravatar image Astronaut  ( 2016-05-12 06:02:39 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-05-10 02:19:09 -0500

Seen: 313 times

Last updated: May 16 '16