PDetection.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 <PObject.h>
17 
18 PAPILLON_BEGIN_NAMESPACE
19 
20 class PFeatureMap;
21 class PFeaturePoint;
22 class PFeatureRectangle;
23 class PFrame;
24 class PGuid;
25 class PList;
26 class PObjectType;
27 class PPoint2Df;
28 class PTrack;
29 class PProperties;
30 
61 class PAPILLON_API_CORE PDetection : public PObject
62 {
63 public:
67  static const PDetection& Bad() { static const PDetection BAD; return BAD; }
68 
78  PDetection();
79 
84  PDetection(const PObjectType& objectType,
85  const PGuid& detectorId,
86  const PFrame& frame,
87  const PFeatureMap& featureMap,
88  float reliability);
89 
94  PDetection(const PGuid& objectId,
95  const PGuid& detectorId,
96  const PFrame& frame,
97  const PObjectType& objectType,
98  const PTrack& track,
99  const PFeatureMap& featureMap,
100  float confidence);
101 
105  PDetection(const PDetection& other);
106 
110  virtual ~PDetection();
111 
115  PDetection& operator=(const PDetection& other);
116 
120  bool operator==(const PDetection& other) const;
121 
125  void Reset();
126 
133  bool IsValid() const;
134 
138  PObjectType GetObjectType() const;
139 
143  PGuid GetObjectId() const;
144 
148  PGuid GetDetectorId() const;
149 
153  const PTrack& GetTrack() const;
154 
158  PTrack& GetTrackShared();
159 
163  const PFrame& GetFrame() const;
164 
168  const PFeatureMap& GetFeatureMap() const;
169 
173  PFeatureMap& GetFeatureMapShared();
174 
178  PList GetFeaturePoints() const;
179 
183  PList GetFeatureRectangles() const;
184 
189  PFeatureRectangle GetFaceRectangle() const;
190 
195  float GetInterocularDistance() const;
196 
200  float GetConfidence() const;
201 
206  const PPoint2Df& GetOrigin() const;
207 
213  PProperties& GetPropertiesShared() const;
214 
218  const PProperties& GetProperties() const;
219 
225  void SetInvalid();
226 
230  void SetObjectType(const PObjectType& objectType);
231 
235  void SetDetectorId(const PGuid& detectorId);
236 
240  void SetFrame(const PFrame& frame);
241 
245  void SetFeatureMap(const PFeatureMap& featureMap);
246 
250  void SetConfidence(float reliability);
251 
256  void SetOrigin(const PPoint2Df& origin);
257 
261  void SetTrack(const PTrack& track);
262 
266  void Translate(float x, float y);
267 
268 private:
269  void SetProperties(const PProperties& properties);
270  friend class PDetectionImpl;
271 };
272 
273 PAPILLON_END_NAMESPACE
The PFeaturePoint class represents a sub-pixel accurate 2D location on an image; PFeaturePoint instan...
Definition: PFeaturePoint.h:28
The PPoint2Df class represents a 2D-point with float coordinates; PPoint2Df instances are immutable (...
Definition: PPoint2Df.h:28
The PFrame class represents any 2D-image (RGB, gray-scale, ...) with a container of additional data p...
Definition: PFrame.h:50
The PList class represents a generic container which handle an ordered collection of PObject; NOT thr...
Definition: PList.h:46
The PProperties class represents a container of properties; each property has a name (PString) and a ...
Definition: PProperties.h:38
The PTrack class represents a Track of object as face or person.
Definition: PTrack.h:28
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
The PDetection class represents something that has been detected by a PDetector.
Definition: PDetection.h:61
The PFeatureRectangle class represents a sub-pixel accurate 2D area on an image; PFeatureRectangle in...
The PGuid class represents a Globally Unique Identifier (GUID); PGuid instances are immutable (thread...
Definition: PGuid.h:28
Class PObject: the root class of all Papillon classes.
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
static const PDetection & Bad()
Returns the constant holding the bad instance of a PDetection.
Definition: PDetection.h:67
The PObjectType class represents a type of object found in a video stream (can be Face...
Definition: PObjectType.h:26