In this section, we will see an example of using cv_bridge for acquiring images from a camera driver, and converting and processing the images using OpenCV APIs. The following is how the example works:
- Subscribe the images from the camera driver from the topic /usb_cam/image_raw (sensor_msgs/Image)
- Convert the ROS images to the OpenCV image type using CvBridge
- Process the OpenCV image using its APIs and find the edges on the image
- Convert the OpenCV image type of the edge detection to the ROS image messages and publish into the topic /edge_detector/processed_image
The step-by-step procedure to build this example follows: