KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pt_face_2d.h
Go to the documentation of this file.
1 /* =========================================================================== *
2  |
3  | Copyright (c) 1994-2011 by Kobus Barnard (author)
4  |
5  | Personal and educational use of this code is granted, provided that this
6  | header is kept intact, and that the authorship is not misrepresented, that
7  | its use is acknowledged in publications, and relevant papers are cited.
8  |
9  | For other use contact the author (kobus AT cs DOT arizona DOT edu).
10  |
11  | Please note that the code in this file has not necessarily been adequately
12  | tested. Naturally, there is no guarantee of performance, support, or fitness
13  | for any particular task. Nonetheless, I am interested in hearing about
14  | problems that you encounter.
15  |
16  | Author: Ernesto Brau
17  * =========================================================================== */
18 
19 /* $Id$ */
20 
21 #ifndef PT_FACE_2D_H
22 #define PT_FACE_2D_H
23 
24 #include <detector_cpp/d_bbox.h>
27 #include <m_cpp/m_vector.h>
30 
31 #include <boost/optional.hpp>
32 
33 namespace kjb {
34 namespace pt {
35 
37 struct Face_2d
38 {
48 
49  Face_2d() {}
50 
51  Face_2d
52  (
53  const Bbox& box,
54  const Vector& leye,
55  const Vector& reye,
56  const Vector& cnose,
57  const Vector& lmouth,
58  const Vector& rmouth,
59  const Vector& mdir = Vector()
60  ) :
61  bbox(box),
62  left_eye(leye),
63  right_eye(reye),
64  nose(cnose),
65  left_mouth(lmouth),
66  right_mouth(rmouth),
67  model_dir(mdir),
68  facemark(NULL)
69  {}
70 };
71 
73 Face_2d project_cstate_face
74 (
75  const Complete_state& cs,
76  const Perspective_camera& cam,
77  double height,
78  double width,
79  double girth
80 );
81 
84 (
85  const Complete_state& cs1,
86  const Complete_state& cs2,
87  const Perspective_camera& cam,
88  double height,
89  double width,
90  double girth
91 );
92 
97 double face_distance
98 (
99  const Face_2d& face_model,
100  const Deva_facemark facemark
101 );
102 
103 }} //namespace kjb::pt
104 
105 #endif /*PT_FACE_2D_H */
106 
Face_2d project_cstate_face(const Complete_state &cs, const Perspective_camera &cam, double height, double width, double girth)
Project a complete state into a face box.
Definition: pt_face_2d.cpp:39
Vector right_eye
Definition: pt_face_2d.h:41
Vector left_mouth
Definition: pt_face_2d.h:43
Class that represents an axis-aligned 2D rectangle. It is defined in terms of its (2D) center...
Definition: gr_2D_bounding_box.h:51
Vector model_dir
Definition: pt_face_2d.h:45
Vector nose
Definition: pt_face_2d.h:42
Definition: d_deva_facemark.h:34
Vector left_eye
Definition: pt_face_2d.h:40
height
Definition: APPgetLargeConnectedEdges.m:33
This class implements vectors, in the linear-algebra sense, with real-valued elements.
Definition: m_vector.h:87
Vector right_mouth
Definition: pt_face_2d.h:44
Bbox bbox
Definition: pt_face_2d.h:39
Visibility visibility
Definition: pt_face_2d.h:46
Represents the information regarding visibility of an actor at a given frame and given all other acto...
Definition: pt_visibility.h:38
2D face information resulting from projecting the 3D head/face.
Definition: pt_face_2d.h:37
St_perspective_camera for modeling a perspective camera using the classic Forsyth and Ponce parametri...
Definition: perspective_camera.h:93
Face_2d()
Definition: pt_face_2d.h:49
double face_distance(const Face_2d &face_model, const Deva_facemark facemark)
Returns the distance between a face_2d model and a detection facemark.
Definition: pt_face_2d.cpp:124
const Deva_facemark * facemark
Definition: pt_face_2d.h:47
Vector face_model_direction(const Complete_state &cs1, const Complete_state &cs2, const Perspective_camera &cam, double height, double width, double girth)
Compute the (2D) model direction for the face..
Definition: pt_face_2d.cpp:94
Definition for the Vector class, a thin wrapper on the KJB Vector struct and its related functionalit...