PFeatureMap.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2018 Digital Barriers plc. All rights reserved.
3  * Contact: http://www.digitalbarriers.com/
4  *
5  * This file is part of the Papillon SDK.
6  *
7  * You can't use, modify or distribute any part of this file without
8  * the explicit written agreements of Digital Barriers.
9  */
10 
15 #pragma once
16 #include <PMap.h>
17 
18 PAPILLON_BEGIN_NAMESPACE
19 
20 class PFeaturePoint;
21 class PFeatureRectangle;
22 class PList;
23 class PPoint2Df;
24 class PPoint2DfList;
25 class PPolygonf;
26 class PRectanglef;
27 class PStringList;
28 
29 
35 class PAPILLON_API_CORE PFeatureMap : public PObject
36 {
37 public:
41  PFeatureMap();
42 
46  PFeatureMap(const PFeatureMap& other);
47 
51  PFeatureMap(const PStringMap& mapFeaturePoints, const PStringMap& mapFeatureRectangles);
52 
56  virtual ~PFeatureMap();
57 
61  PFeatureMap& operator=(const PFeatureMap& other);
62 
68  void Clear();
69 
75  bool IsFeaturePointEmpty() const;
76 
82  bool IsFeatureRectangleEmpty() const;
83 
89  papillon::int32 FeaturePointSize() const;
90 
96  papillon::int32 FeatureRectangleSize() const;
97 
104  void Add(const PFeaturePoint& p);
105 
112  void Add(const PFeatureRectangle& p);
113 
119  void AddPoint(const PFeaturePoint& p);
120 
126  void AddRectangle(const PFeatureRectangle& p);
127 
133  bool Remove(const PString& name);
134 
138  PPoint2DfList GetPoints() const;
139 
143  PList GetFeaturePoints() const;
144 
148  bool GetFeaturePoints(PStringMap& featurePoints) const;
149 
155  bool GetFeaturePointByName(const PString& name, PFeaturePoint& o_featurePoint) const;
156 
161  PFeaturePoint GetFeaturePointByName(const PString& name) const;
162 
166  PList GetFeatureRectangles() const;
167 
172  PPoint2Df GetLeftEyeCentre() const;
173 
178  PPoint2Df GetRightEyeCentre() const;
179 
183  PPoint2Df GetMidEyeCentre() const;
184 
191  PPoint2Df GetMouthCentre() const;
192 
198  bool GetFeatureRectangleByName(const PString& name, PFeatureRectangle& o_featureRectangle) const;
199 
204  PFeatureRectangle GetFeatureRectangleByName(const PString& name) const;
205 
209  PFeatureRectangle GetFaceRectangle() const;
210 
215  float GetInterocularDistance() const;
216 
220  PStringList GetFeaturePointNames() const;
221 
225  PStringList GetFeatureRectangleNames() const;
226 
230  PRectanglef GetBoundingBox() const;
231 
235  PPolygonf GetBoundingPolygon() const;
236 
241  PPolygonf GetBoundingPolygon(const PStringList& listFeatures) const;
242 
249  PPoint2Df GetCentreOfMass() const;
250 
258  PPoint2Df GetCentreOfMass(const PStringList& listFeatures) const;
259 
263  bool GetFeatureRectangles(PStringMap& featureRectangles) const;
264 
268  void Translate(float x, float y);
269 
273  void Translate(const PPoint2Df &value);
274 
278  void Scale(float scale);
279 };
280 
281 PAPILLON_END_NAMESPACE
The PFeaturePoint class represents a sub-pixel accurate 2D location on an image; PFeaturePoint instan...
Definition: PFeaturePoint.h:28
The PString class provides an Unicode character strings.
Definition: PString.h:37
The PPoint2Df class represents a 2D-point with float coordinates; PPoint2Df instances are immutable (...
Definition: PPoint2Df.h:28
papillon::PMap< papillon::PString, papillon::PObject > PStringMap
Definition: PMap.h:167
The PPoint2DfList class represents a list of PPoint2Df.
Definition: PPoint2DfList.h:37
Class PMap: a generic associative container (map).
The PList class represents a generic container which handle an ordered collection of PObject; NOT thr...
Definition: PList.h:46
The PPolygonf class represents a 2D closed polygon with float coordinates.
Definition: PPolygonf.h:29
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
The PStringList class represents a list of PString; NOT thread-safe.
Definition: PStringList.h:26
The PFeatureRectangle class represents a sub-pixel accurate 2D area on an image; PFeatureRectangle in...
The PRectanglef class represents an axis-aligned rectangle with float coordinates; PRectanglef instan...
Definition: PRectanglef.h:34
PObject & operator=(const PObject &obj)
Performs a shared copy of other to this object.
Definition: PObject.h:45
The PFeatureMap class represents a collection of PFeaturePoint&#39;s or PFeatureRectangle&#39;s.
Definition: PFeatureMap.h:35