gaze  0.1.0
Perform gaze tracking with common webcams.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
data.h
1 #ifndef INCLUDE_GAZE_UTIL_DATA_H_
2 #define INCLUDE_GAZE_UTIL_DATA_H_
3 
4 #include <chrono> // NOLINT
5 #include <iostream>
6 #include <map>
7 #include <string>
8 #include <utility> // Not used, but cpplint detects swap() as part of this
9 #include <vector>
10 
11 #include "opencv2/core.hpp"
12 #include "dlib/opencv.h"
13 #include "dlib/image_processing.h"
14 
15 
16 namespace gaze {
17 
18 namespace util {
19 
27 struct Data {
30  Data();
31  Data(const Data& data);
32 
39  Data& operator=(Data data);
41 
48 
52  dlib::array2d<dlib::bgr_pixel> image;
54 
55 
64  dlib::full_object_detection landmarks;
65 
69  dlib::array<dlib::array2d<double>> eyes;
71 
75  dlib::array<dlib::point> centers;
76 
83 
89 
96 
101 
107 
112 
113  private:
119  void swap(Data& data);
120 };
121 
131  const Data& data) {
132  ostr << "Source image size: " << data.source_image.size() << std::endl
133  << "dlib image size: " << data.image.size() << std::endl
134  << "Face: " << data.landmarks.get_rect() << std::endl
135  << "Eyes detected: " << data.eyes.size() << std::endl;
136  return ostr;
137 }
138 
139 } // namespace util
140 
141 } // namespace gaze
142 
143 #endif // INCLUDE_GAZE_UTIL_DATA_H_
dlib::array< dlib::array2d< double > > eyes
Definition: data.h:69
dlib::array< dlib::point > centers
Definition: data.h:75
std::ostream & operator<<(std::ostream &ostr, const Data &data)
Definition: data.h:130
dlib::array2d< dlib::bgr_pixel > image
Definition: data.h:52
std::vector< cv::Vec3d > gaze_points
Definition: data.h:100
cv::Vec2d estimated_gaze_point
Definition: data.h:105
cv::Mat head_rotation
Definition: data.h:82
MatSize size
dlib::full_object_detection landmarks
Definition: data.h:64
std::map< std::string, double > execution_times
Definition: data.h:111
cv::Mat head_translation
Definition: data.h:87
Data & operator=(Data data)
Definition: data.cpp:52
Wraps the data acquired per frame into a single instance.
Definition: data.h:27
basic_ostream< _CharT, _Traits > & endl(basic_ostream< _CharT, _Traits > &__os)
std::vector< cv::Vec3d > pupils
Definition: data.h:95
cv::Mat source_image
Definition: data.h:47