34 #include <opencv2/imgproc/imgproc.hpp> 46 ROS_INFO(
"Initializing recording:\nWidth/Height/Filename: %d / %d / %s",
width_,
height_, directory.c_str() );
49 cv::VideoWriter::fourcc(
'M',
'J',
'P',
'G'),
53 if (!video_writer_->isOpened())
55 ROS_ERROR(
"Failed to open video file for writing.");
85 switch (frame.format())
87 case QImage::Format_ARGB32:
91 image = cv::Mat(frame.height(), frame.width(), CV_8UC4, frame.bits());
92 cv::cvtColor(image, temp_image, cv::COLOR_BGRA2BGR);
93 cv::flip(temp_image, image, 0);
109 catch (
const std::exception& e)
117 ROS_INFO(
"Stopping video recording.");
bool initializeWriter(const std::string &directory, int width, int height)
void processFrame(QImage frame)
#define ROS_WARN_THROTTLE(period,...)
#define ROS_ERROR_THROTTLE(period,...)
boost::shared_ptr< cv::VideoWriter > video_writer_
#define ROS_DEBUG_THROTTLE(period,...)