KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pt_data.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: pt_data.h 18751 2015-04-03 20:33:13Z ernesto $ */
20 
21 #ifndef PT_DATA_H
22 #define PT_DATA_H
23 
24 #include <mcmcda_cpp/mcmcda_data.h>
26 //#include <people_tracking_cpp/pt_face_detection.h>
28 #include <set>
29 #include <string>
30 #include <vector>
31 
32 namespace kjb {
33 namespace pt {
34 
41 class Box_data : public mcmcda::Data<Detection_box>
42 {
43 public:
44  typedef std::set<Detection_box> Box_set;
45 
46 private:
47  double width_;
48  double height_;
49  double max_pnoise_;
50 
51 public:
53  Box_data
54  (
55  double width,
56  double height,
57  double max_prob_noise = 1.0
58  ) :
59  width_(width),
60  height_(height),
61  max_pnoise_(max_prob_noise)
62  {}
63 
67  Box_set read_single_time(const std::string& filename) const;
68 
71  (
72  const Box_set& data_t,
73  const std::string& filename
74  ) const;
75 
80  void thin_out(size_t beg_fr, size_t end_fr, size_t every_nth);
81 
83  void remove_overlapping(double thresh);
84 
86  double image_width() const { return width_; }
87 
89  double image_height() const { return height_; }
90 };
91 
93 // * @class Face_data
94 // *
95 // * Class representing tracking face-data. This class inherits from the
96 // * general mcmcda::Data class, and overwrites the read member function.
97 // */
98 //class Face_data : public mcmcda::Data<Face_detection>
99 //{
100 //private:
101 // double width_;
102 // double height_;
103 //
104 //public:
105 // /** @brief Constructor */
106 // Face_data(double width, double height) : width_(width), height_(height)
107 // {}
108 //
109 // /**
110 // * @brief Reads boxes for single time from single file.
111 // */
112 // std::set<Face_detection> read_single_time
113 // (
114 // const std::string& filename
115 // ) const;
116 //};
117 
120 (
121  const Vector& lefe_eye,
122  const Vector& right_eye,
123  const Vector& nose,
124  const Vector& left_mouth,
125  const Vector& right_mouth,
126  double yaw
127 );
128 
129 typedef std::vector<std::vector<Deva_facemark> > Facemark_data;
130 
132 (
133  const std::vector<std::string>& fps,
134  double img_width,
135  double img_height
136 );
137 
139 (
140  const Facemark_data& fm_data,
141  const std::vector<std::string>& fps,
142  double img_width,
143  double img_height
144 );
145 
146 }} //namespace kjb::pt
147 
148 #endif /*PT_DATA_H */
149 
void remove_overlapping(double thresh)
Removes overlapping boxes from a set.
Definition: pt_data.cpp:96
Box_set read_single_time(const std::string &filename) const
Reads boxes for single time from single file.
Definition: pt_data.cpp:37
Deva_facemark build_deva_facemark(const Vector &lefe_eye, const Vector &right_eye, const Vector &nose, const Vector &left_mouth, const Vector &right_mouth, double yaw)
Constructor.
Definition: pt_data.cpp:167
Facemark_data parse_deva_facemarks(const std::vector< std::string > &fps, double img_width, double img_height)
Definition: pt_data.cpp:213
double image_width() const
Returns the image width.
Definition: pt_data.h:86
Definition: pt_data.h:41
A class that holds data for the tracking problem.
Definition: mcmcda_data.h:50
Definition: d_deva_facemark.h:34
height
Definition: APPgetLargeConnectedEdges.m:33
double image_height() const
Returns the image height.
Definition: pt_data.h:89
This class implements vectors, in the linear-algebra sense, with real-valued elements.
Definition: m_vector.h:87
std::set< Detection_box > Box_set
Definition: pt_data.h:44
std::vector< std::vector< Deva_facemark > > Facemark_data
Definition: pt_data.h:129
void thin_out(size_t beg_fr, size_t end_fr, size_t every_nth)
Thins out the data. Only frames in [beg_fr, end_fr] are kept, and only every every_nth frame is kept...
Definition: pt_data.cpp:83
Box_data(double width, double height, double max_prob_noise=1.0)
Constructor.
Definition: pt_data.h:54
void write_single_time(const Box_set &data_t, const std::string &filename) const
Write boxes for single time to single file.
Definition: pt_data.cpp:63
void write_deva_facemarks(const Facemark_data &fm_data, const std::vector< std::string > &fps, double img_width, double img_height)
Definition: pt_data.cpp:244