3DiVi Face SDK  3.21.0
 Указатель Классы Пространства имен Файлы Функции Переменные Определения типов Перечисления Элементы перечислений Свойства Группы
DepthLivenessEstimator.h
См. документацию.
1 
9 #ifndef __PBIO_API__PBIO__DEPTH_LIVENESS_ESTIMATOR_H_
10 #define __PBIO_API__PBIO__DEPTH_LIVENESS_ESTIMATOR_H_
11 
12 #include <sstream>
13 #include <vector>
14 
15 
16 #include "ComplexObject.h"
17 #include "DepthMapRaw.h"
18 #include "Error.h"
19 #include "RawSample.h"
20 #include "SmartPtr.h"
21 #include "stl_wraps_impls/WrapOStreamImpl.h"
22 
23 
24 namespace pbio
25 {
26 
27 class FacerecService;
28 
34 class DepthLivenessEstimator : public ComplexObject
35 {
36 public:
37 
43  typedef LightSmartPtr<DepthLivenessEstimator>::tPtr Ptr;
44 
50  enum Liveness
51  {
58 
64  REAL = 1,
65 
71  FAKE = 2,
72 
79  };
80 
81 
114  const pbio::RawSample& sample,
115  const pbio::DepthMapRaw depth_map);
116 
117 private:
118 
120  const DHPtr &dll_handle,
121  void* impl);
122 
123  friend class FacerecService;
124  friend class object_with_ref_counter<DepthLivenessEstimator>;
125 };
126 
127 } // pbio namespace
128 
129 
130 
134 
135 namespace pbio
136 {
137 
138 
139 inline
140 DepthLivenessEstimator::DepthLivenessEstimator(
141  const DHPtr &dll_handle,
142  void* impl):
143 ComplexObject(dll_handle, impl)
144 {
145  // nothing else
146 }
147 
148 
149 inline
151  const pbio::RawSample& sample,
152  const pbio::DepthMapRaw depth_map)
153 {
154  void* exception = NULL;
155 
156  const int result = _dll_handle->DepthLivenessEstimator_estimateLiveness(
157  _impl,
158  (pbio::facerec::RawSampleImpl const*) sample._impl,
159  depth_map.depth_map_rows,
160  depth_map.depth_map_cols,
161  depth_map.depth_map_2_image_offset_y,
162  depth_map.depth_map_2_image_offset_x,
163  depth_map.depth_map_2_image_scale_x,
164  depth_map.depth_map_2_image_scale_y,
165  depth_map.horizontal_fov,
166  depth_map.vertical_fov,
167  depth_map.depth_unit_in_millimeters,
168  depth_map.depth_data,
169  depth_map.depth_data_stride_in_bytes,
170  &exception);
171 
172  checkException(exception, *_dll_handle);
173 
174  if(result == 1)
175  return REAL;
176 
177  if(result == 2)
178  return FAKE;
179 
180  return NOT_ENOUGH_DATA;
181 }
182 
183 
184 } // pbio namespace
185 
186 #endif // __PBIO_API__PBIO__DEPTH_LIVENESS_ESTIMATOR_H_
float depth_map_2_image_scale_x
Параметр соответствия координат исходного изображения и карты глубины.
Definition: DepthMapRaw.h:56
Интерфейсный объект для создания других интерфейсных объектов.
Definition: FacerecService.h:64
float depth_unit_in_millimeters
Масштаб значений, содержащихся в depth_data.
Definition: DepthMapRaw.h:84
int depth_data_stride_in_bytes
Шаг в байтах.
Definition: DepthMapRaw.h:98
Интерфейсный объект, хранящий образец лица.
Definition: RawSample.h:49
float horizontal_fov
Горизонтальный угол обзора карты глубины в градусах.
Definition: DepthMapRaw.h:70
int depth_map_cols
Ширина карты глубины.
Definition: DepthMapRaw.h:35
Лицо было взято с фото.
Definition: DepthLivenessEstimator.h:71
Интерфейсный объект для определения принадлежности лица реальному человеку.
Definition: DepthLivenessEstimator.h:34
float depth_map_2_image_offset_y
Параметр соответствия координат исходного изображения и карты глубины.
Definition: DepthMapRaw.h:49
Лицо принадлежит реальному человеку.
Definition: DepthLivenessEstimator.h:64
int depth_map_rows
Высота карты глубины.
Definition: DepthMapRaw.h:28
Error - класс исключений, выбрасываемых при возникновении ошибок.
RawSample - Интерфейсный объект, хранящий образец лица.
Liveness estimateLiveness(const pbio::RawSample &sample, const pbio::DepthMapRaw depth_map)
Определить принадлежность лица реальному человеку. Карта глубины должна быть синхронизирована и отрег...
Definition: DepthLivenessEstimator.h:150
Карта глубины, отрегистрированная в соответствии с исходным цветным изображением. Соответствие межд...
Definition: DepthMapRaw.h:21
SmartPtr.
float depth_map_2_image_scale_y
Параметр соответствия координат исходного изображения и карты глубины.
Definition: DepthMapRaw.h:63
float depth_map_2_image_offset_x
Параметр соответствия координат исходного изображения и карты глубины.
Definition: DepthMapRaw.h:42
float vertical_fov
Вертикальный угол обзора карты глубины в градусах.
Definition: DepthMapRaw.h:77
Недостаточно информации.
Definition: DepthLivenessEstimator.h:57
Лицо не было проверено.
Definition: DepthLivenessEstimator.h:78
Liveness
Результат определения принадлежности лица живому человеку.
Definition: DepthLivenessEstimator.h:50
uint16_t const * depth_data
Указатель на данные глубины.
Definition: DepthMapRaw.h:91
LightSmartPtr< DepthLivenessEstimator >::tPtr Ptr
Псевдоним для типа умного указателя на DepthLivenessEstimator.
Definition: DepthLivenessEstimator.h:43