Catching streaming images raspicam
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 ...
Asked by Medo BKB on 2018-11-24 16:19:44 UTC
Answers
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.
Asked by PeteBlackerThe3rd on 2018-11-25 06:26:58 UTC
Comments
thank you my bro this was helpful ...
Asked by Medo BKB on 2018-12-18 09:18:10 UTC
@Medo BKB if this answered your question, then please click the check mark to mark this answer as correct
Asked by jayess on 2018-12-21 19:38:04 UTC
Comments