Understanding the face tracker code

Let's start with the header file. The ROS header files we are using in the code lie here. We have to include ros/ros.h in every ROS C++ node; otherwise, the source code will not compile. The remaining three headers are image-transport headers, which have functions to publish and subscribe to image messages in low bandwidth. The cv_bridge header has functions to convert between OpenCV ROS data types. The image_encoding.h header has the image-encoding format used during ROS-OpenCV conversions:

    #include <ros/ros.h> 
    #include <image_transport/image_transport.h> 
    #include <cv_bridge/cv_bridge.h> 
    #include <sensor_msgs/image_encodings.h> 

The next set of headers is for OpenCV. The imgproc header consists of image-processing ...

Get ROS Programming: Building Powerful Robots now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.