PDetector.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 
18 #pragma once
19 #include <PPluginInstance.h>
20 #include <PProperties.h>
21 
22 PAPILLON_BEGIN_NAMESPACE
23 
24 class PDetection;
25 class PDetectionList;
26 class PFrame;
27 class PPlugin;
28 class PRectanglei;
29 class PSizei;
30 
33 
50 class PAPILLON_API_CORE PDetector : public PPluginInstance {
51  public:
59 
60  public:
65  static PResult Create(const PString& productName, const PProperties& parameters, PDetector& detector);
66 
71  static PResult Create(const PPlugin& plugin, const PProperties& parameters, PDetector& detector);
72 
77  static PResult Create(const PString& productName, const PProperties& parameters, const PString& parametersPrefix, PDetector& detector);
78 
83  static PResult Create(const PPlugin& plugin, const PProperties& parameters, const PString& parametersPrefix, PDetector& detector);
84 
88  PDetector();
89 
93  PDetector(const PDetector& other);
94 
98  virtual ~PDetector();
99 
103  PDetector& operator=(const PDetector& other);
104 
109  PResult Detect(const PFrame& frame, PDetectionList& detectionList) const;
110 
115  PResult Detect(const PFrame& frame,
116  const PProperties& parameters,
117  const PString& parametersPrefix,
118  PDetectionList& detectionList) const;
119 
124  PResult Localise(PDetectionList& detectionList) const;
125 
130  PResult SetThreshold(float threshold);
131 
136  float GetThreshold() const;
137 
142  PResult SetRegionOfInterest(const PRectanglei& roi);
143 
148  PRectanglei GetRegionOfInterest() const;
149 
154  PResult SetMinDetectionSize(const papillon::int32 minDetectionSize);
155 
160  PResult SetMinDetectionSize(const PSizei& minDetectionSize);
161 
166  PSizei GetMinDetectionSize() const;
167 
172  PResult SetMaxDetectionSize(const papillon::int32 maxDetectionSize);
173 
178  PResult SetMaxDetectionSize(const PSizei& maxDetectionSize);
179 
184  PSizei GetMaxDetectionSize() const;
185 
191  PResult SetMaxDetections(papillon::int32 maxDetections);
192 
197  papillon::int32 GetMaxDetections() const;
198 
203  PResult EnableLocaliser(bool enabled);
204 
209  bool IsLocaliserEnabled() const;
210 
216  PResult SetLocaliser(const PString& localiserName = PString());
217 
223  PResult SetLocaliser(const PDetector& localiser);
224 
229  PDetector GetLocaliser() const;
230 };
231 
233 
234 PAPILLON_END_NAMESPACE
PPluginInstance & operator=(const PPluginInstance &other)
Performs a shared copy of other to this object.
The PDetector class is the parent class for all detection algorithms which analyse an image or a vide...
Definition: PDetector.h:50
The PString class provides an Unicode character strings.
Definition: PString.h:37
The PFrame class represents any 2D-image (RGB, gray-scale, ...) with a container of additional data p...
Definition: PFrame.h:50
static const PString C_PARAM_INT32_MAX_DETECTIONS
"max number of detections" parameter (int32)
Definition: PDetector.h:56
The PSizei class represents the size of an image or a rectangle: width (int) and height (int); PSizei...
Definition: PSizei.h:27
static const PString C_PARAM_DETECTOR_LOCALISER
"localiser" parameter (PDetector)
Definition: PDetector.h:58
The PDetectionList class represents nothing more than a collection of detections (PDetection), Typically PDetectionList&#39;s are returned from a PDetector.
The PResult class represents the result returned by most of Papillon functions; this class is used to...
Definition: PResult.h:159
Class PProperties: a container of generic properties indexed by their name.
The PProperties class represents a container of properties; each property has a name (PString) and a ...
Definition: PProperties.h:38
static const PString C_PARAM_SIZEI_MIN_DETECTION_SIZE
"min detection size" parameter (PSizei)
Definition: PDetector.h:54
static const PString C_PARAM_SIZEI_MAX_DETECTION_SIZE
"max detection size" parameter (PSizei)
Definition: PDetector.h:55
static const PString C_PARAM_BOOL_LOCALISER
"is localiser enabled" parameter (bool)
Definition: PDetector.h:57
The PPlugin class represents a Papillon plugin (input video source, detector, describer, ...); thread-safe.
Definition: PPlugin.h:45
static const PString C_PARAM_RECTI_REGION_OF_INTEREST
"region of interest" parameter (PRectanglei)
Definition: PDetector.h:53
The PDetection class represents something that has been detected by a PDetector.
Definition: PDetection.h:61
The PRectanglei class represents an axis-aligned rectangle with 32-bit int coordinates; PRectanglei i...
Definition: PRectanglei.h:33
Class PPluginInstance: super class for PAnalytics, PDetector, PDescriber, etc.
The PPluginInstance class is the super class for PAnalytics, PDetector, PDescriber which handle the d...
static const PString C_PARAM_FLOAT_THRESHOLD
"threshold" parameter(float)
Definition: PDetector.h:52
PResult Create(const PPlugin &plugin, const PProperties &parameters, const PString &parametersPrefix)
Create an instance from the specified plugin with the specified parameters.