Ask Your Question

Catching streaming images raspicam

asked 2018-11-24 15:19:44 -0500

Medo BKB gravatar image

I can successfully publish video streaming from raspberry to laptop using raspicam node , and now i wanna do some image processing in my laptop to those streaming frames , but i don't know how to catch those frames in python script?? , and knowing that raspicam was written in c++ i don't know how to convert that to python , or without converting i can use some python script to do some image processing ...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-11-25 05:26:58 -0500

To subscribe to an image topic in a python script you'll need a subscriber and callback as described in the publisher and subscriber tutorial. However to process the image you'll need to use the CvBridge module to convert the ROS images to openCV images for processing. A full example of this in python is shown here. In this example the code subscribes to an image topic, and the callback draws a circle onto the image, displays it on screen and re-publishes it on a different image topic.

This second example should get you started, there is no need to modify the raspicam node at all. When a camera node is publishing images to ROS they can be accessed by python and C++ nodes just as easily.

Hope this helps.

edit flag offensive delete link more


thank you my bro this was helpful ...

Medo BKB gravatar image Medo BKB  ( 2018-12-18 08:18:10 -0500 )edit

@Medo BKB if this answered your question, then please click the check mark to mark this answer as correct

jayess gravatar image jayess  ( 2018-12-21 18:38:04 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-11-24 15:19:44 -0500

Seen: 431 times

Last updated: Nov 25 '18