gaze  0.1.0
Perform gaze tracking with common webcams.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
dlibcv.h
1 #ifndef INCLUDE_GAZE_UTIL_DLIBCV_H_
2 #define INCLUDE_GAZE_UTIL_DLIBCV_H_
3 
4 #include <vector>
5 
6 #include "opencv2/opencv.hpp"
7 #include "dlib/geometry.h"
8 
9 
10 namespace gaze {
11 
12 namespace util {
13 
20 dlib::point cv_to_dlib(const cv::Point& to_convert);
21 
28 dlib::point cv_to_dlib(const cv::Vec3d& to_convert);
29 
30 template<typename T, int N>
31 dlib::vector<T, N> cv_to_dlib(const cv::Vec<T, N>& to_convert) {
32  return dlib::vector<T, N>(to_convert[0], to_convert[1], to_convert[2]);
33 }
34 
35 template<typename T, int N>
36 cv::Vec<T, N> dlib_to_cv(const dlib::vector<T, N>& to_convert) {
37  return cv::Vec<T, N>(to_convert.x(), to_convert.y(), to_convert.z());
38 }
39 
46 dlib::rectangle cv_to_dlib(const cv::Rect& to_convert);
47 
54 cv::Rect dlib_to_cv(const dlib::rectangle& to_convert);
55 
56 } // namespace util
57 
58 } // namespace gaze
59 
60 #endif // INCLUDE_GAZE_UTIL_DLIBCV_H_
dlib::point cv_to_dlib(const cv::Point &to_convert)
Definition: dlibcv.cpp:8
void rectangle(InputOutputArray img, Point pt1, Point pt2, const Scalar &color, int thickness=1, int lineType=LINE_8, int shift=0)
cv::Rect dlib_to_cv(const dlib::rectangle &to_convert)
Definition: dlibcv.cpp:17