1 // Copyright (C) 2014  Davis E. King (davis@dlib.net)
2 // License: Boost Software License   See LICENSE.txt for the full license.
3 #undef DLIB_RENDER_FACE_DeTECTIONS_ABSTRACT_H_
4 #ifdef DLIB_RENDER_FACE_DeTECTIONS_ABSTRACT_H_
5 
6 #include "full_object_detection_abstract.h"
7 #include "../gui_widgets.h"
8 
9 namespace dlib
10 {
11 
12 // ----------------------------------------------------------------------------------------
13 
14     inline std::vector<image_window::overlay_line> render_face_detections (
15         const std::vector<full_object_detection>& dets,
16         const rgb_pixel color = rgb_pixel(0,255,0)
17     );
18     /*!
19         requires
20             - for all valid i:
21                 - dets[i].num_parts() == 68 || dets[i].num_parts() == 5
22         ensures
23             - Interprets the given objects as face detections with parts annotated using
24               either the iBUG face landmark scheme or a 5 point face annotation.  We then
25               return a set of overlay lines that will draw the objects onto the screen in a
26               way that properly draws the outline of the face features defined by the part
27               locations.
28             - returns a vector with dets.size() elements, each containing the lines
29               necessary to render a face detection from dets.
30             - The 5 point face annotation scheme is assumed to be:
31                 - det part 0 == left eye corner, outside part of eye.
32                 - det part 1 == left eye corner, inside part of eye.
33                 - det part 2 == right eye corner, outside part of eye.
34                 - det part 3 == right eye corner, inside part of eye.
35                 - det part 4 == immediately under the nose, right at the top of the philtrum.
36     !*/
37 
38 // ----------------------------------------------------------------------------------------
39 
40     inline std::vector<image_window::overlay_line> render_face_detections (
41         const full_object_detection& det,
42         const rgb_pixel color = rgb_pixel(0,255,0)
43     );
44     /*!
45         requires
46             - det.num_parts() == 68 || det.num_parts() == 5
47         ensures
48             - This function is identical to the above render_face_detections() routine
49               except that it takes just a single full_object_detection instead of a
50               std::vector of them.
51     !*/
52 
53 // ----------------------------------------------------------------------------------------
54 
55 }
56 
57 #endif // DLIB_RENDER_FACE_DeTECTIONS_ABSTRACT_H_
58 
59 
60