I'm using the rosbag API to sequentially process messages in a bag file. Some of these messages are images (of the type `sensor_msgs/Image`).
Is there an image viewing package that has an API that allows me to pass it an image of that type, and it will show the image? More specifically, I'm looking to do this:
// Specify topics to be read
std::vector topics;
topics.push_back(imu_topic);
topics.push_back(camera_topic);
rosbag::View view(bag, rosbag::TopicQuery(topics));
// Loop through messages
BOOST_FOREACH(rosbag::MessageInstance const m, view)
{
if (m.getTopic() == camera_topic)
{
sensor_msgs::Image::ConstPtr image = m.instantiate();
if (image != NULL)
{
// CALL A FUNCTION TO VIEW IMAGE
}
}
}
↧