Face Engine SDK  4.6.0
A face detection, recognition and tracking engine.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Detection.h
1 #pragma once
2 
3 namespace fsdk {
4 
9  template <typename Type>
10  struct BaseDetection {
11 
12  typedef Type ElementType;
13 
15  float score;
16 
21  BaseDetection() noexcept
22  : score(0.f) {}
23 
24  template<typename OtherType>
26  *this = other;
27  }
28 
34  bool isValid() const noexcept {
35  return rect.isValid() && (score >= 0.f && score <= 1.f);
36  }
37 
38  template <typename OtherType>
39  BaseDetection& operator = (const BaseDetection<OtherType>& other) noexcept {
40  if(reinterpret_cast<const void*>(this) != reinterpret_cast<const void*>(&other)) {
41  score = other.score;
42  rect = static_cast<BaseRect<Type>>(other.rect);
43  }
44  return *this;
45  }
46  };
47 
48  typedef BaseDetection<int> Detection;
49 }
float score
Object detection score.
Definition: Detection.h:15
bool isValid() const noexcept
Checks whether a detection is valid.
Definition: Detection.h:34
Rectangle.
Definition: Rect.h:10
BaseDetection() noexcept
Initializes a default detection.
Definition: Detection.h:21
BaseRect< Type > rect
Object bounding box.
Definition: Detection.h:14
Face detection. Stores a detected face bounding box within a source image frame as well as detection...
Definition: Detection.h:10