Welcome to Transbot SE repository
8. ROS+Opencv foundation
8. ROS+Opencv foundation
8. ROS+Opencv foundation8.1. Overview8.2, USB camera8.2.1. Start USB camera8.2.2. Start the color graph subscription node8.2.3. Start color image inversion8.2.4. Release image
This lesson uses a USB camera as an example.
8.1. Overview
Wiki: http://wiki.ros.org/cv_bridge/
Tutorials: http://wiki.ros.org/cv_bridge/Tutorials
Source code: https://github.com/ros-perception/vision_opencv.git
Function package location: ~/transbot_ws/src/transbot_visual
ROS has already integrated Opencv3.0 and above during the installation process, so there is almost no need to think too much about the installation configuration. ROS uses its own sensor_msgs/Image message format transfers images and cannot directly perform image processing, but the provided [CvBridge] can perfectly convert and be converted image data formats. [CvBridge] is a ROS library, equivalent to the bridge between ROS and Opencv.
Opencv and ROS image data conversion is shown in the figure below:

Although the installation configuration does not require too much consideration, the usage environment still needs to be configured, mainly the two files [package.xml] and [CMakeLists.txt]. This function package not only uses [CvBridge], but also requires [Opencv] and [PCL], so they are configured together.
- package.xml
Add the following content