gaze
0.1.0
Perform gaze tracking with common webcams.
|
This class wraps the gaze tracking process. More...
#include "gaze/gaze_tracker.h"
Public Member Functions | |
GazeTracker (const std::string subject_id="default_subject", const bool debug=false) | |
void | calibrate () |
Data access | |
const std::pair< int, int > | get_current_gaze_point () const |
Initialization | |
This method allows initialization of a GazeTracker instance. If GazeTracker() was used to construct the instance, you must call either of these functions before perfoming any actions. | |
void | init (const std::string subject_id, const bool debug=false) |
Trial handling | |
These functions are used to partition an experiment into trials. When you start a trial, call the GazeTracker::start_trial(const std::string) method. After the trial you should issue GazeTracker::stop_trial(). Note that the GazeTracker keeps tracking until you destroy the instance, the only difference in calling the start and stop trial functions is that the identifier will be available next to the data for the specific trial. | |
void | start_trial (const std::string identifier) |
void | stop_trial () |
This class wraps the gaze tracking process.
This is the GazeTracker, the heart of gaze. It allows for easy initialization, tracking, and trial definitions.
Definition at line 24 of file gaze_tracker.h.
gaze::GazeTracker::GazeTracker | ( | const std::string | subject_id = "default_subject" , |
const bool | debug = false |
||
) |
Constructs and initializes a GazeTracker instance for a video source. See GazeTracker::init(std::string, std::string, std::string).
subject_id | The subject identifier. |
debug | Starts the gaze_tracker in debug mode, bringing up additional debuggin screens. |
Definition at line 19 of file gaze_tracker.cpp.
References init().
void gaze::GazeTracker::calibrate | ( | ) |
Calibrates the GazeTracker.
Definition at line 36 of file gaze_tracker.cpp.
References std::cerr, std::cout, and std::endl().
const std::pair< int, int > gaze::GazeTracker::get_current_gaze_point | ( | ) | const |
Definition at line 44 of file gaze_tracker.cpp.
References std::cerr, std::endl(), gaze::util::Data::estimated_gaze_point, and gaze::Pipeline::get_data().
void gaze::GazeTracker::init | ( | const std::string | subject_id, |
const bool | debug = false |
||
) |
Initializes the GazeTracker.
It immediately starts tracking.
subject_id | The subject ID, used to store the data in the correct file. |
debug | Starts the gaze_tracker in debug mode, bringing up additional debuggin screens. |
Definition at line 57 of file gaze_tracker.cpp.
Referenced by GazeTracker().
void gaze::GazeTracker::start_trial | ( | const std::string | identifier | ) |
Makes the GazeTracker associate its output data with the identifier
until either GazeTracker::stop_trial() is called or a new trial is started by calling this function with a different identifier.
The identifiers are not checked for uniqueness! It is very well possible to use the same identifier multiple tames, analyzing the data correctly is then up to you.
identifier | The trial identifier. |
Definition at line 103 of file gaze_tracker.cpp.
References std::cerr, std::cout, and std::endl().
void gaze::GazeTracker::stop_trial | ( | ) |
Stops associating data with any specific trial.
Definition at line 114 of file gaze_tracker.cpp.
References std::cerr, std::cout, and std::endl().