-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframe_writer.h
More file actions
34 lines (25 loc) · 803 Bytes
/
Copy pathframe_writer.h
File metadata and controls
34 lines (25 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef FRAME_WRITER_H
#define FRAME_WRITER_H
#include <memory>
#include <string>
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include "message_queue.h"
// Class which provides functionality to write the frames as videos or images
class CustomFrameWriter
{
public:
// Constructor and Destructor
CustomFrameWriter(std::string filename, int numFrames, double _frameRate, cv::Size _frameSize);
~CustomFrameWriter();
// Function to capture frames from video
bool writeFramesFromQueueToVideo(MessageQueue<cv::Mat> &msgq);
bool writeFrameToImage(cv::Mat &frame);
private:
// Unique pointer holding the video writer object
std::unique_ptr<cv::VideoWriter> _vWrite;
// Number of frames in video
int _numFrames;
};
#endif