-
Notifications
You must be signed in to change notification settings - Fork 74
/
ImageInput.h
57 lines (42 loc) · 994 Bytes
/
ImageInput.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* ImageInput.h
*
*/
#ifndef IMAGEINPUT_H_
#define IMAGEINPUT_H_
#include <ctime>
#include <string>
#include <list>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "Directory.h"
class ImageInput {
public:
virtual ~ImageInput();
virtual bool nextImage() = 0;
virtual cv::Mat & getImage();
virtual time_t getTime();
virtual void setOutputDir(const std::string & outDir);
virtual void saveImage();
protected:
cv::Mat _img;
time_t _time;
std::string _outDir;
};
class DirectoryInput: public ImageInput {
public:
DirectoryInput(const Directory & directory);
virtual bool nextImage();
private:
Directory _directory;
std::list<std::string>::const_iterator _itFilename;
std::list<std::string> _filenameList;
};
class CameraInput: public ImageInput {
public:
CameraInput(int device);
virtual bool nextImage();
private:
cv::VideoCapture _capture;
};
#endif /* IMAGEINPUT_H_ */