1
|
#pragma once
|
2
|
|
3
|
|
4
|
|
5
|
#include <iostream>
|
6
|
#include <cstdlib>
|
7
|
|
8
|
#include <rsb/Factory.h>
|
9
|
|
10
|
#include <opencv/cv.h>
|
11
|
#include <opencv/cvaux.h>
|
12
|
#include <opencv/highgui.h>
|
13
|
|
14
|
|
15
|
#include <rsb/Listener.h>
|
16
|
#include <rsb/QueuePushHandler.h>
|
17
|
#include <rsb/converter/Repository.h>
|
18
|
#include <rsb/Informer.h>
|
19
|
#include <rsc/threading/SynchronizedQueue.h>
|
20
|
#include <rst/converters/opencv/IplImageConverter.h>
|
21
|
#include <ChessBase\FixationConverter.h>
|
22
|
#include <ChessBase\ImageFixationConverter.h>
|
23
|
|
24
|
using namespace cv;
|
25
|
using namespace std;
|
26
|
class DataReader
|
27
|
{
|
28
|
public:
|
29
|
DataReader(void);
|
30
|
~DataReader(void);
|
31
|
int initRSB(string inScope);
|
32
|
int initVidCap(string videoPath,int skipframes);
|
33
|
int readImageFile(Mat* image);
|
34
|
|
35
|
#ifdef USE_IMAGES_INSTEAD_OF_IMAGEFIXATIONS
|
36
|
int readImageRSB(Mat* image);
|
37
|
inline boost::shared_ptr<rsc::threading::SynchronizedQueue<boost::shared_ptr<IplImage> > > getImageQueue() {
|
38
|
return imageQueue;
|
39
|
}
|
40
|
#else
|
41
|
int readImageFixationRSB(Mat* image, Fixation* fixation);
|
42
|
inline boost::shared_ptr<rsc::threading::SynchronizedQueue<boost::shared_ptr<ImageFixation> > > getImageFixationQueue() {
|
43
|
return imageFixationQueue;
|
44
|
}
|
45
|
#endif
|
46
|
|
47
|
|
48
|
private:
|
49
|
cv::VideoCapture vidCap;
|
50
|
|
51
|
#ifdef USE_IMAGES_INSTEAD_OF_IMAGEFIXATIONS
|
52
|
boost::shared_ptr<rsc::threading::SynchronizedQueue<boost::shared_ptr<IplImage> > > imageQueue;
|
53
|
rsb::converter::Converter<string>::Ptr imageConverter;
|
54
|
#else
|
55
|
boost::shared_ptr<rsc::threading::SynchronizedQueue<boost::shared_ptr<ImageFixation> > > imageFixationQueue;
|
56
|
rsb::converter::Converter<string>::Ptr imageConverter;
|
57
|
rsb::converter::Converter<string>::Ptr imageFixationConverter;
|
58
|
#endif
|
59
|
|
60
|
rsb::ListenerPtr imageListener;
|
61
|
};
|
62
|
|