8#include <RobotsIO/Utils/ImageFileProbe.h>
10#include <opencv2/opencv.hpp>
12using namespace RobotsIO::Utils;
15ImageFileProbe::ImageFileProbe(
const std::string& output_path,
const std::string& prefix,
const std::string& output_format) :
16 output_prefix_(output_path),
17 output_format_(output_format)
19 if (output_prefix_.back() !=
'/')
20 output_prefix_ +=
'/';
23 output_prefix_ += (prefix +
"_");
27ImageFileProbe::~ImageFileProbe()
31void ImageFileProbe::on_new_data()
33 data_cv_ = RobotsIO::Utils::any_cast<cv::Mat>(get_data());
35 cv::imwrite(output_prefix_ + std::to_string(frame_counter_) +
"." + output_format_, data_cv_);