Enrollment
28.2.0
Theme:
Default
Robot
Toggle main menu visibility
Loading...
Searching...
No Matches
FaceCrop.h
Go to the documentation of this file.
1
9
10
#pragma once
11
12
#include "
enrollment/Exception/EnrollmentException.h
"
13
#include "enrollment/Export.h"
14
#include <ostream>
15
#include <string>
16
17
namespace
inno
18
{
22
*/
23
enum class
FaceCrop
: uint8_t
24
{
27
TOKEN_NOT_FRONTAL
= 0,
33
FULL
= 1,
39
TOKEN
= 2,
42
FULL_NOT_ALIGNED
= 3
43
};
44
45
// The numbers are from ISO standard and are tested in unit tests.
46
// NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
47
53
*/
54
static
constexpr
bool
IsFaceCropMethodValid
(
FaceCrop
faceCrop)
55
{
56
switch
(faceCrop)
57
{
58
case
FaceCrop::TOKEN_NOT_FRONTAL
:
59
[[fallthrough]];
60
case
FaceCrop::FULL
:
61
[[fallthrough]];
62
case
FaceCrop::TOKEN
:
63
[[fallthrough]];
64
case
FaceCrop::FULL_NOT_ALIGNED
:
65
return
true
;
66
default
:
67
return
false
;
68
}
69
}
70
71
inline
std::string ToString(
FaceCrop
faceCrop)
72
{
73
switch
(faceCrop)
74
{
75
case
FaceCrop::TOKEN_NOT_FRONTAL
:
76
return
"TOKEN_NOT_FRONTAL"
;
77
case
FaceCrop::FULL
:
78
return
"FULL"
;
79
case
FaceCrop::TOKEN
:
80
return
"TOKEN"
;
81
case
FaceCrop::FULL_NOT_ALIGNED
:
82
return
"FULL_NOT_ALIGNED"
;
83
}
84
return
"UNKNOWN"
;
85
}
86
87
inline
std::ostream& operator<<(std::ostream& os,
FaceCrop
faceCrop)
88
{
89
os << ToString(faceCrop);
90
return
os;
91
}
92
}
// namespace inno
EnrollmentException.h
IsFaceCropMethodValid
static constexpr bool IsFaceCropMethodValid(FaceCrop faceCrop)
Function validates the value of FaceCrop enum.
Definition
FaceCrop.h:53
FaceCrop
FaceCrop
Defines different Crop methods.
Definition
FaceCrop.h:23
FaceCrop::FULL_NOT_ALIGNED
@ FULL_NOT_ALIGNED
Crops bounding box provided by FaceCrop::FULL method as is from original FaceCapture.
Definition
FaceCrop.h:41
FaceCrop::TOKEN
@ TOKEN
Token Frontal Image cropping method defined in ISO/IEC 19794-5 standard.
Definition
FaceCrop.h:38
FaceCrop::FULL
@ FULL
Full Frontal Image cropping method defined in ISO/IEC 19794-5 standard.
Definition
FaceCrop.h:32
FaceCrop::TOKEN_NOT_FRONTAL
@ TOKEN_NOT_FRONTAL
Image cropping method similar to TOKEN but works quite well even on non-frontal images It will produc...
Definition
FaceCrop.h:26
Face
FaceCrop.h
Generated by
1.17.0