gaze
0.1.0
Perform gaze tracking with common webcams.
|
Estimates the head pose from landmarks and source image. More...
#include "gaze/pipeline_steps/head_pose_estimation.h"
Public Member Functions | |
void | process (util::Data &data) override |
void | visualize (util::Data &data) override |
Public Member Functions inherited from gaze::PipelineStep | |
PipelineStep () | |
std::string | get_name () |
virtual | ~PipelineStep ()=default |
Public Member Functions inherited from gaze::gui::Visualizeable< widget_type > | |
std::shared_ptr< dlib::drawable > | init (dlib::drawable_window &parent, int width, int height, std::string text="No visualization.") final |
void | remove_widget () override |
Public Member Functions inherited from gaze::gui::VisualizeableBase | |
virtual | ~VisualizeableBase ()=default |
Protected Member Functions | |
cv::Matx33d | read_or_set_camera_matrix (const util::Data &data) |
cv::Mat | get_and_maybe_read_distortions (const util::Data &data) |
Additional Inherited Members | |
Protected Attributes inherited from gaze::PipelineStep | |
int | number |
std::string | name |
Protected Attributes inherited from gaze::gui::Visualizeable< widget_type > | |
std::shared_ptr< widget_type > | widget |
Estimates the head pose from landmarks and source image.
///
Definition at line 24 of file head_pose_estimation.h.
|
protected |
Returns a distortions matrix.
If the distortions matrix is available from the configuration, the configuration value is stored and used. Otherwise, it is assumed to be a zero matrix.
data | The data to read from, if no yaml data is available. |
Definition at line 149 of file head_pose_estimation.cpp.
References CV_64F, gaze::util::get_config(), and cv::Mat::zeros().
Referenced by process().
|
overridevirtual |
Estimates the head pose from face landmarks and the input image.
data | The data object to be updated. |
data
the modified data object. Implements gaze::PipelineStep.
Definition at line 108 of file head_pose_estimation.cpp.
References get_and_maybe_read_distortions(), gaze::util::Data::head_rotation, gaze::util::Data::head_translation, gaze::util::Data::landmarks, std::vector< _Tp, _Alloc >::push_back(), read_or_set_camera_matrix(), cv::solvePnP(), and cv::SOLVEPNP_ITERATIVE.
|
protected |
Returns a camera matrix.
If it was not loaded yet, it will be read from gaze.yaml
(as created using OpenCV's calibration tool, also check the gaze.default.yaml to see how to integrate it).
If nothing can be found in the configuration, the following matrix is calculated and returned:
Where .
data | The data to read from, if no yaml data is available. |
Definition at line 131 of file head_pose_estimation.cpp.
References cv::Mat::cols, gaze::util::get_config(), cv::Mat::rows, and gaze::util::Data::source_image.
Referenced by process().
|
overridevirtual |
Visualizes the estimated head pose.
data | The data object to be visualized. |
Implements gaze::gui::VisualizeableBase.
Definition at line 126 of file head_pose_estimation.cpp.
References gaze::util::Data::image, and gaze::gui::Visualizeable< widget_type >::widget.