31#include <opencv2/opencv.hpp>
42 const std::filesystem::path& filePath,
43 const std::string& name,
44 unsigned int jpg_quality) :
67 const std::chrono::microseconds
timestamp)
70 const std::filesystem::path path =
deriveFramePath(sequence_number, frame_name);
71 std::vector<int> params{cv::IMWRITE_JPEG_QUALITY,
static_cast<int>(
m_jpg_quality)};
72 cv::imwrite(path.string(), frame, params);
virtual std::tuple< unsigned int, std::string > writeMetadataFrame(const CByteImage &frame, std::chrono::microseconds timestamp)
virtual void writeMetadataLine(const std::string &var_name, std::string_view var_type, std::string_view var_value)
void startRecording() override
Starts the recording manually if constructed empty.
AbstractSequencedRecordingStrategy()
Default constructor to manually start the recording.
std::filesystem::path deriveFramePath(const unsigned int sequence_number, const std::string &frame_name)
Returns the next sequenced full path and increments the sequence number.
void startRecording() override
Starts the recording manually if constructed empty.
unsigned int m_jpg_quality
void recordFrame(const cv::Mat &frame, std::chrono::microseconds timestamp) override
Adds the given frame to the recording.
~JPGRecordingStrategy() override
#define ARMARX_CHECK_LESS_EQUAL(lhs, rhs)
This macro evaluates whether lhs is less or equal (<=) rhs and if it turns out to be false it will th...