Ask Your Question

Getting webcam images using ROS and openCV in python

asked 2013-09-17 10:31:20 -0600

u_will_neva_no gravatar image

updated 2013-09-17 13:22:54 -0600

berak gravatar image

Hi everyone, I am able to get webcam images using ROS and openCV and manipulate the image using C++ however I want to achieve the same for python.

I am using cv_bridge to convert images from ROS to openCV and vice versa so I looked at the code from the tutorials. I want to convert the following C++ code into python:

int main(int argc, char** argv)
ros::init(argc, argv, "image_converter");
ros::NodeHandle nh;
image_transport::ImageTransport it(nh);
image_transport::Subscriber sub = it.subscribe("camera/image_raw", 1, imageCb);
image_pub_ = it.advertise("camera/image_processed", 1);

return 0;

I am trying to get the camera feed from my webcam and also publish this over ROS. I have achieved this using C++ but want to do the same all in python. I learnt this from: link:text

I am converting between ROS and openCV images using the cv_bridge. This is using cv and not cv2. If anyone has a tutorial on doing this for cv2 do let me know.

Thanks :)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-11-26 08:19:05 -0600

did you get any answer or solution ??? if yes then plx send let me know

edit flag offensive delete link more

Question Tools


Asked: 2013-09-17 10:31:20 -0600

Seen: 3,888 times

Last updated: Nov 26 '14