7 #include <dlib/image_processing/full_object_detection.h> 23 dlib::full_object_detection
const &
face,
25 float * p_average_depth
30 float average_depth = 0;
32 for(
int i = markup_from;
i <= markup_to; ++
i )
34 auto pt = face.part(
i );
35 auto depth_in_pixels = *(data + pt.y() * frame.
get_width() + pt.x());
36 if( !depth_in_pixels )
44 *p_average_depth = average_depth / n_points;
60 dlib::full_object_detection
const &
face 66 float left_ear_depth = 100, right_ear_depth = 100;
70 float ear_depth =
std::min( right_ear_depth, left_ear_depth );
80 float right_eye_depth;
86 float eye_depth =
std::min( left_eye_depth, right_eye_depth );
100 if( nose_depth >= eye_depth )
102 if( eye_depth - nose_depth > 0.07
f )
104 if( ear_depth <= eye_depth )
106 if( mouth_depth <= nose_depth )
108 if( mouth_depth > chin_depth )
114 float x = std::max( { nose_depth, eye_depth, ear_depth, mouth_depth, chin_depth } );
115 float n =
std::min( { nose_depth, eye_depth, ear_depth, mouth_depth, chin_depth } );
bool find_depth_from(rs2::depth_frame const &frame, float const depth_scale, dlib::full_object_detection const &face, markup_68 markup_from, markup_68 markup_to, float *p_average_depth)
const void * get_data() const
bool validate_face(rs2::depth_frame const &frame, float const depth_scale, dlib::full_object_detection const &face)
GLenum GLuint GLint GLenum face