forked from IntelRealSense/RealSenseID
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDeviceConfig.h
130 lines (115 loc) · 3.86 KB
/
DeviceConfig.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2020-2021 Intel Corporation. All Rights Reserved.
#pragma once
#include "RealSenseIDExports.h"
namespace RealSenseID
{
struct RSID_API DeviceConfig
{
/**
* @enum CameraRotation
* @brief Camera rotation.
*/
enum class CameraRotation
{
Rotation_0_Deg = 0, // default
Rotation_180_Deg = 1,
Rotation_90_Deg = 2,
Rotation_270_Deg =3
};
/**
* @enum SecurityLevel
* @brief SecurityLevel to allow
*/
enum class SecurityLevel
{
High = 0, // high security, no mask support, all AS algo(s) will be activated
Medium = 1, // default mode to support masks, projector wont be activated.
Low = 2, // low security level, only main AS algo will be activated.
};
/**
* @enum AlgoFlow
* @brief Algorithms which will be used during authentication
*/
enum class AlgoFlow
{
All = 0, // default
FaceDetectionOnly = 1, // face detection only
SpoofOnly = 2, // spoof only
RecognitionOnly = 3 // recognition only
};
/**
* @enum FaceSelectionPolicy
* @brief Controls whether to run authentication on all (up to 5) detected faces vs single (closest) face
*/
enum class FaceSelectionPolicy
{
Single = 0, // default, run authentication on closest face
All = 1 // run authentication on all (up to 5) detected faces
};
enum class DumpMode
{
None = 0,
CroppedFace = 1,
FullFrame = 2,
};
// we allow 3 confidence levels. This is used in our Matcher during authentication :
// each level means a different set of thresholds is used.
// This allow the user the flexibility to choose between 3 different FPR rates (Low, Medium, High).
// Currently all sets are the "High" confidence level thresholds.
enum class MatcherConfidenceLevel
{
High = 0, // default
Medium = 1,
Low = 2
};
CameraRotation camera_rotation = CameraRotation::Rotation_0_Deg;
SecurityLevel security_level = SecurityLevel::Medium;
AlgoFlow algo_flow = AlgoFlow::All;
FaceSelectionPolicy face_selection_policy = FaceSelectionPolicy::Single;
DumpMode dump_mode = DumpMode::None;
MatcherConfidenceLevel matcher_confidence_level = MatcherConfidenceLevel::High;
};
RSID_API const char* Description(DeviceConfig::CameraRotation rotation);
RSID_API const char* Description(DeviceConfig::SecurityLevel level);
RSID_API const char* Description(DeviceConfig::AlgoFlow algoMode);
RSID_API const char* Description(DeviceConfig::FaceSelectionPolicy policy);
RSID_API const char* Description(DeviceConfig::DumpMode dump_mode);
RSID_API const char* Description(DeviceConfig::MatcherConfidenceLevel matcher_confidence_level);
template <typename OStream>
inline OStream& operator<<(OStream& os, const DeviceConfig::CameraRotation& rotation)
{
os << Description(rotation);
return os;
}
template <typename OStream>
inline OStream& operator<<(OStream& os, const DeviceConfig::AlgoFlow& mode)
{
os << Description(mode);
return os;
}
template <typename OStream>
inline OStream& operator<<(OStream& os, const DeviceConfig::SecurityLevel& level)
{
os << Description(level);
return os;
}
template <typename OStream>
inline OStream& operator<<(OStream& os, const DeviceConfig::FaceSelectionPolicy& policy)
{
os << Description(policy);
return os;
}
template <typename OStream>
inline OStream& operator<<(OStream& os, const DeviceConfig::DumpMode& dump_mode)
{
os << Description(dump_mode);
return os;
}
template <typename OStream>
inline OStream& operator<<(OStream& os, const DeviceConfig::MatcherConfidenceLevel& matcher_confidence_level)
{
os << Description(matcher_confidence_level);
return os;
}
} // namespace RealSenseID