Asking for insight into CV2 and CV2 Bridge

Hi all,

I know "CvBridge is a python module made for ROS to be able to use OpenCV image processing library (OpenCV)”, a quote from here.

I’d like to know what’s exactly going on. It seems both the import OpenCV and its Bridge are python 3 packages. How could it bridge the communication between ROS and the OpenCV?

Any ideas would be highly appreciated!


Hi, let me answer your question with a question :smiley: - to draw what you have left out of the question. Why not - why do you think it cannot bridge communication?

@bayodesegun Thanks for you kind reply!

Actually I’d just like to know the main ideas of how the bridge works instead of doubting it.

I considered it a bit, for example, I’m not sure which level is the brige implemented in, does it connect the cv2 to the ROS by topic, service, action? Or in the source code level? For the former one, I think the bridge should compile some messages type also for the ROS side so that they could communicate.


Understanding the low-level details is definitely interesting, but understanding how to use it is the main focus here at the Academy. I have not looked at those low-level details myself, so I can’t tell you. But I’m sure you’ll find some documentation with a simple Google search :wink:.


I don’t know all the details of OpenCV bridge, but essentially is a library to be able to convert ROS image messages types easily and most importantly , fast. Because Image objects contain SO much info, you must do some “Voodoo Magic” to make those conversions instantly.