3DiVi Face SDK  3.23.0
 Указатель Классы Пространства имен Файлы Функции Переменные Определения типов Перечисления Элементы перечислений Свойства Группы Страницы
FacerecService.h
См. документацию.
1 
9 #ifndef __PBIO_API__PBIO__FACEREC_SERVICE_H_
10 #define __PBIO_API__PBIO__FACEREC_SERVICE_H_
11 
12 
13 #include <istream>
14 #include <stdexcept>
15 #include <utility>
16 #include <vector>
17 #include <facerec/libfacerec.h>
18 
19 #ifdef ANDROID
20 #include <jni.h>
21 #endif
22 
23 #include "stl_wraps_impls/WrapIStreamImpl.h"
24 #include "stl_wraps_impls/WrapOStreamImpl.h"
25 
26 
27 #include "AgeGenderEstimator.h"
28 #include "CameraCalibrator.h"
29 #include "Capturer.h"
30 #include "ComplexObject.h"
31 #include "DepthLivenessEstimator.h"
32 #include "IRLivenessEstimator.h"
33 #include "ActiveLiveness.h"
34 #include "Liveness2DEstimator.h"
36 #include "EmotionsEstimator.h"
37 #include "Error.h"
38 #include "ExceptionCheck.h"
39 #include "FaceQualityEstimator.h"
40 #include "LivenessEstimator.h"
41 #include "QualityEstimator.h"
42 #include "RawSample.h"
43 #include "Recognizer.h"
44 #include "SmartPtr.h"
45 #include "Template.h"
46 #include "VideoWorker.h"
47 #include "StructStorage.h"
48 #include "Config.h"
49 #include "ProcessingUnit.h"
50 
51 #ifndef WITHOUT_PROCESSING_BLOCK
52 #include "Context.h"
53 #include "ProcessingBlock.h"
54 #endif
55 
56 namespace pbio
57 {
58 
64 class FacerecService : ComplexObject
65 {
66 public:
67 
73  typedef LightSmartPtr<FacerecService>::tPtr Ptr;
74 
75  typedef pbio::Config Config;
76 
81  struct License
82  {
87  const std::string license_body;
88 
89  License(std::string license_body) : license_body(license_body) { }
90  };
91 
97  struct LicenseState
98  {
104  {
109  std::string name;
110 
115  int64_t max_value;
116 
121  int64_t value;
122  };
123 
128  bool online;
129 
130 
135  std::string android_app_id;
136 
141  std::string android_serial;
142 
147  std::string ios_app_id;
148 
153  std::string hardware_reg;
154 
159  std::vector<CounterState> counters;
160  };
161 
200  const std::string dll_path,
201  std::string facerec_conf_dir,
202  const std::string license_dir = std::string());
203 
238  const std::string dll_path,
239  std::string facerec_conf_dir,
240  const pbio::FacerecService::License license);
241 
243 
244  // internal usage only
246  void* const ae_ptr,
247  const std::string dll_path,
248  std::string facerec_conf_dir,
249  const std::string license,
250  const bool is_license_dir);
251 
253 
254 
272  std::string getVersion() const;
273 
283  void forceOnlineLicenseUpdate() const;
284 
311 
335  AgeGenderEstimator::Ptr createAgeGenderEstimator(const std::string ini_file) const;
336 
360  QualityEstimator::Ptr createQualityEstimator(const std::string ini_file) const;
361 
385  FaceQualityEstimator::Ptr createFaceQualityEstimator(const std::string ini_file) const;
386 
405 
429  EmotionsEstimator::Ptr createEmotionsEstimator(const std::string ini_file) const;
430 
475  const char* ini_file,
476  const bool processing = true,
477  const bool matching = true,
478  const bool processing_less_memory_consumption = false) const;
479 
480 
525  const pbio::FacerecService::Config recognizer_config,
526  const bool processing = true,
527  const bool matching = true,
528  const bool processing_less_memory_consumption = false) const;
529 
562  const pbio::VideoWorker::Params params) const;
563 
564 
607  const pbio::FacerecService::Config video_worker_config,
608  const char* recognizer_ini_file,
609  const int streams_count,
610  const int processing_threads_count,
611  const int matching_threads_count) const;
612 
613 
656  const pbio::FacerecService::Config video_worker_config,
657  const pbio::FacerecService::Config recognizer_config,
658  const int streams_count,
659  const int processing_threads_count,
660  const int matching_threads_count) const;
661 
662 
663 
691  RawSample::Ptr loadRawSample(std::istream &binary_stream) const;
692 
720  RawSample::Ptr loadRawSample(pbio::stl_wraps::WrapIStream &binary_stream) const;
721 
722 
786  pbio::stl_wraps::WrapIStream &binary_stream,
787  const RawImage image,
788  const double space_translation_x = 0,
789  const double space_translation_y = 0,
790  const double space_scale = 1) const;
791 
796  std::istream &binary_stream,
797  const RawImage image,
798  const double space_translation_x = 0,
799  const double space_translation_y = 0,
800  const double space_scale = 1) const;
801 
856  pbio::stl_wraps::WrapIStream &binary_stream,
857  const unsigned char *image_data,
858  int image_data_size,
859  const double space_translation_x = 0,
860  const double space_translation_y = 0,
861  const double space_scale = 1) const;
862 
868  std::istream &binary_stream,
869  const unsigned char *image_data,
870  int image_data_size,
871  const double space_translation_x = 0,
872  const double space_translation_y = 0,
873  const double space_scale = 1) const;
874 
875 
894 
895 
920  const std::string ini_file) const;
921 
922 
947  const pbio::FacerecService::Config config) const;
948 
949 
974  const std::string ini_file) const;
975 
976 
1001  const pbio::FacerecService::Config config) const;
1002 
1003 
1028  const std::string ini_file) const;
1029 
1030 
1055  const pbio::FacerecService::Config config) const;
1056 
1081  const std::string ini_file) const;
1082 
1084 
1085  ProcessingUnit::Ptr createProcessingUnit(
1086  const int block_type,
1087  const char* serializedConfig) const;
1088 
1089 #ifndef WITHOUT_PROCESSING_BLOCK
1090 
1098  Context createContext() const;
1099 
1112  Context createContextFromEncodedImage(const uint8_t* data, uint64_t dataSize) const;
1113 
1124  Context createContextFromEncodedImage(const std::vector<uint8_t>& data) const;
1125 
1136  Context createContextFromEncodedImage(const std::string& data) const;
1137 
1138  Context createContextFromEncodedImage(const std::vector<char>& data) const;
1139 
1158  Context createContextFromFrame(uint8_t* data, int32_t width, int32_t height, Context::Format format = Context::Format::FORMAT_BGR, int32_t baseAngle = 0) const;
1159 
1160  Context createContextFromJsonFile(const char* path);
1161 
1172  Context createContextFromJsonFile(std::string path);
1173 
1184  ProcessingBlock createProcessingBlock(const Context& config) const;
1185 #endif
1186 
1188 
1206  LicenseState getLicenseState() const;
1207 
1208 
1222  void keepAlgorithmsCache() const;
1223 
1235  void freeAlgorithmsCache() const;
1236 
1237 
1278  const int width,
1279  const int height,
1280  const RawImage::Format format);
1281 
1282 
1283 #ifdef ANDROID
1284 
1324  JNIEnv *env,
1325  jobject android_media_image);
1326 #endif // ifdef ANDROID
1327 
1328 
1369  void convertYUV2ARGB(
1370  const RawImage image,
1371  const bool downscale_x2,
1372  void* const result_buffer);
1373 
1374 
1375  void convertYUV2RGB(
1376  const RawImage image,
1377  const bool downscale_x2,
1378  const int base_angle,
1379  void* const result_buffer);
1380 
1381 
1382  void convertBGRA88882RGB(
1383  const RawImage image,
1384  const bool downscale_x2,
1385  const int base_angle,
1386  void* const result_buffer);
1387 
1388 
1389 private:
1390 
1391  const std::string _facerec_conf_dir;
1392 
1393  friend class object_with_ref_counter<FacerecService>;
1394 protected:
1396  const DHPtr &dll_handle,
1397  const std::string &facerec_conf_dir,
1398  void* impl);
1399 };
1400 
1401 } // pbio namespace
1402 
1403 
1404 
1405 
1409 
1410 
1411 namespace pbio
1412 {
1413 
1414 
1415 // static
1416 inline
1418  const std::string dll_path,
1419  std::string facerec_conf_dir,
1420  const std::string license_dir)
1421 {
1422  return createService(NULL, dll_path, facerec_conf_dir, license_dir, true);
1423 }
1424 
1425 // static
1426 inline
1428  const std::string dll_path,
1429  std::string facerec_conf_dir,
1430  const pbio::FacerecService::License license)
1431 {
1432  return createService(NULL, dll_path, facerec_conf_dir, license.license_body, false);
1433 }
1434 
1435 // static
1436 inline
1438  void* const ae_ptr,
1439  const std::string dll_path,
1440  std::string facerec_conf_dir,
1441  const std::string license,
1442  const bool is_license_dir)
1443 {
1444 
1445 #ifdef __STATIC_LIBFACEREC_BUILD__
1446  (void) dll_path;
1447 
1448  const DHPtr dll_handle( DHPtr::make() );
1449 #else
1450  const DHPtr dll_handle( DHPtr::make(dll_path.c_str()) );
1451 #endif
1452 
1453  if(facerec_conf_dir.empty())
1454  {
1455  facerec_conf_dir = "./";
1456  }
1457  else if(facerec_conf_dir[facerec_conf_dir.length() - 1] != '/')
1458  {
1459  facerec_conf_dir += '/';
1460  }
1461 
1462  void* exception = NULL;
1463 
1464  void* the_impl;
1465 
1466  if (is_license_dir)
1467  {
1468  the_impl = dll_handle->FacerecService_constructor3(
1469  ae_ptr,
1470  facerec_conf_dir.c_str(),
1471  license.empty() ?
1472  NULL :
1473  license.c_str(),
1474  dll_path.c_str(),
1475  &exception);
1476  }else
1477  {
1478  the_impl = dll_handle->FacerecService_constructor5(
1479  ae_ptr,
1480  facerec_conf_dir.c_str(),
1481  license.c_str(),
1482  dll_path.c_str(),
1483  &exception);
1484  }
1485 
1486  checkException(exception, *dll_handle);
1487 
1488  return FacerecService::Ptr::make(
1489  dll_handle,
1490  facerec_conf_dir,
1491  the_impl);
1492 }
1493 
1494 
1495 inline
1496 FacerecService::FacerecService(
1497  const DHPtr &dll_handle,
1498  const std::string &facerec_conf_dir,
1499  void* impl):
1500 ComplexObject(dll_handle, impl),
1501 _facerec_conf_dir(facerec_conf_dir)
1502 {
1503  std::string lib_version = getVersion();
1504 
1505  if (LIBFACEREC_VERSION != lib_version)
1506  std::cerr << "WARNING: The version in the header does not match the version in the library. Header version: "
1507  << LIBFACEREC_VERSION << ", library version: " << lib_version << std::endl;
1508 }
1509 
1510 
1511 inline
1512 std::string FacerecService::getVersion() const
1513 {
1514  std::ostringstream version_stream;
1515  pbio::stl_wraps::WrapOStreamImpl version_stream_wrap(version_stream);
1516 
1517  void* exception = NULL;
1518 
1519  _dll_handle->get_version(
1520  &version_stream_wrap,
1521  pbio::stl_wraps::WrapOStream::write_func,
1522  &exception);
1523 
1524  checkException(exception, *_dll_handle);
1525 
1526  return version_stream.str();
1527 }
1528 
1529 
1530 inline
1532 {
1533  void* exception = NULL;
1534 
1535  _dll_handle->FacerecService_forceOnlineLicenseUpdate(
1536  _impl,
1537  &exception);
1538 
1539  checkException(exception, *_dll_handle);
1540 }
1541 
1542 inline
1544  const pbio::FacerecService::Config config) const
1545 {
1546  const std::string file_path = _facerec_conf_dir + config.config_filepath;
1547 
1548  std::vector<char const*> overridden_keys;
1549  std::vector<double> overridden_values;
1550 
1551  config.prepare(overridden_keys, overridden_values);
1552 
1553  void* exception = NULL;
1554 
1555  pbio::facerec::CapturerImpl* const capturer_impl =
1556  _dll_handle->FacerecService_createCapturerE(
1557  _impl,
1558  file_path.c_str(),
1559  overridden_keys.size(),
1560  overridden_keys.empty() ? NULL : &(overridden_keys[0]),
1561  overridden_values.empty() ? NULL : &(overridden_values[0]),
1562  &exception);
1563 
1564  checkException(exception, *_dll_handle);
1565 
1566  return Capturer::Ptr::make(_dll_handle, capturer_impl);
1567 }
1568 
1569 inline
1571 {
1572  const std::string file_path = _facerec_conf_dir + ini_file;
1573 
1574  void* exception = NULL;
1575 
1576  pbio::facerec::AgeGenderEstimatorImpl* const the_impl =
1577  _dll_handle->FacerecService_createAgeGenderEstimator(
1578  _impl,
1579  file_path.c_str(),
1580  &exception);
1581 
1582  checkException(exception, *_dll_handle);
1583 
1584  return AgeGenderEstimator::Ptr::make(_dll_handle, the_impl);
1585 }
1586 
1587 
1588 inline
1590 {
1591  const std::string file_path = _facerec_conf_dir + ini_file;
1592 
1593  void* exception = NULL;
1594 
1595  pbio::facerec::QualityEstimatorImpl* const the_impl =
1596  _dll_handle->FacerecService_createQualityEstimator(
1597  _impl,
1598  file_path.c_str(),
1599  &exception);
1600 
1601  checkException(exception, *_dll_handle);
1602 
1603  return QualityEstimator::Ptr::make(_dll_handle, the_impl);
1604 }
1605 
1606 
1607 inline
1609 {
1610  const std::string file_path = _facerec_conf_dir + ini_file;
1611 
1612  void* exception = NULL;
1613 
1614  pbio::facerec::FaceQualityEstimatorImpl* const the_impl =
1615  _dll_handle->FacerecService_createFaceQualityEstimator(
1616  _impl,
1617  file_path.c_str(),
1618  &exception);
1619 
1620  checkException(exception, *_dll_handle);
1621 
1622  return FaceQualityEstimator::Ptr::make(_dll_handle, the_impl);
1623 }
1624 
1625 inline
1627 {
1628  void* exception = NULL;
1629 
1630  pbio::facerec::LivenessEstimatorImpl* const the_impl =
1631  _dll_handle->FacerecService_createLivenessEstimator(
1632  _impl,
1633  &exception);
1634 
1635  checkException(exception, *_dll_handle);
1636 
1637  return LivenessEstimator::Ptr::make(_dll_handle, the_impl);
1638 }
1639 
1640 
1641 inline
1643  const std::string ini_file) const
1644 {
1645  const std::string file_path = _facerec_conf_dir + ini_file;
1646 
1647  void* exception = NULL;
1648 
1649  pbio::facerec::EmotionsEstimatorImpl* const the_impl =
1650  _dll_handle->FacerecService_createEmotionsEstimator(
1651  _impl,
1652  file_path.c_str(),
1653  &exception);
1654 
1655  checkException(exception, *_dll_handle);
1656 
1657  return EmotionsEstimator::Ptr::make(_dll_handle, the_impl);
1658 }
1659 
1660 
1661 inline
1663  const char* ini_file,
1664  const bool processing,
1665  const bool matching,
1666  const bool processing_less_memory_consumption) const
1667 {
1668  const std::string file_path = _facerec_conf_dir + ini_file;
1669 
1670  void* exception = NULL;
1671 
1672  pbio::facerec::RecognizerImpl* const recognizer_impl =
1673  _dll_handle->FacerecService_createRecognizer2(
1674  _impl,
1675  file_path.c_str(),
1676  0,
1677  NULL,
1678  NULL,
1679  (int) processing,
1680  (int) matching,
1681  (int) processing_less_memory_consumption,
1682  &exception);
1683 
1684  checkException(exception, *_dll_handle);
1685 
1686  return Recognizer::Ptr::make(_dll_handle, recognizer_impl);
1687 }
1688 
1689 
1690 inline
1692  const pbio::FacerecService::Config recognizer_config,
1693  const bool processing,
1694  const bool matching,
1695  const bool processing_less_memory_consumption) const
1696 {
1697  const std::string file_path = _facerec_conf_dir + recognizer_config.config_filepath;
1698 
1699  std::vector<char const*> overridden_keys;
1700  std::vector<double> overridden_values;
1701 
1702  recognizer_config.prepare(overridden_keys, overridden_values);
1703 
1704  void* exception = NULL;
1705 
1706  pbio::facerec::RecognizerImpl* const recognizer_impl =
1707  _dll_handle->FacerecService_createRecognizer2(
1708  _impl,
1709  file_path.c_str(),
1710  overridden_keys.size(),
1711  overridden_keys.empty() ? NULL : &(overridden_keys[0]),
1712  overridden_values.empty() ? NULL : &(overridden_values[0]),
1713  (int) processing,
1714  (int) matching,
1715  (int) processing_less_memory_consumption,
1716  &exception);
1717 
1718  checkException(exception, *_dll_handle);
1719 
1720  return Recognizer::Ptr::make(_dll_handle, recognizer_impl);
1721 }
1722 
1723 
1724 
1725 inline
1727  const pbio::FacerecService::Config video_worker_ini_file,
1728  const char* recognizer_ini_file,
1729  const int streams_count,
1730  const int processing_threads_count,
1731  const int matching_threads_count) const
1732 {
1733  return createVideoWorker(
1735  .video_worker_config(video_worker_ini_file)
1736  .recognizer_ini_file(recognizer_ini_file)
1737  .streams_count(streams_count)
1738  .processing_threads_count(processing_threads_count)
1739  .matching_threads_count(matching_threads_count)
1740  );
1741 }
1742 
1743 inline
1745  const pbio::FacerecService::Config video_worker_ini_file,
1746  const pbio::FacerecService::Config recognizer_config,
1747  const int streams_count,
1748  const int processing_threads_count,
1749  const int matching_threads_count) const
1750 {
1751  return createVideoWorker(
1753  .video_worker_config(video_worker_ini_file)
1754  .recognizer_config(recognizer_config)
1755  .streams_count(streams_count)
1756  .processing_threads_count(processing_threads_count)
1757  .matching_threads_count(matching_threads_count)
1758  );
1759 }
1760 
1761 inline
1763  const VideoWorker::Params params) const
1764 {
1765  std::vector<char const*> vw_overridden_keys;
1766  std::vector<double> vw_overridden_values;
1767 
1768  params._video_worker_config.prepare(vw_overridden_keys, vw_overridden_values);
1769  std::vector<std::string> extra_over_params;
1770 
1771  if(!params._active_liveness_checks_order.empty()){
1772  bool is_unique = true;
1773  for (auto it = params._active_liveness_checks_order.begin(); it != params._active_liveness_checks_order.end(); ++it)
1774  if (std::find(it + 1, params._active_liveness_checks_order.end(), *it) != params._active_liveness_checks_order.end()) {
1775  is_unique = false;
1776  break;
1777  }
1778  if(!is_unique)
1779  throw pbio::Error(0x3302330e,
1780  "Error 0x3302330e: Set a unique order of `active_liveness_checks_order` for Active Liveness.");
1781  for (size_t i = 0; i < params._active_liveness_checks_order.size(); i++){
1782  ActiveLiveness::CheckType check = params._active_liveness_checks_order[i];
1783  std::string check_str = ActiveLiveness::CheckTypeToString(check);
1784  extra_over_params.push_back("active_liveness.check_" + check_str);
1785  vw_overridden_keys.push_back(extra_over_params.back().c_str());
1786  vw_overridden_values.push_back(-(double)(i+1));
1787  }
1788  }
1789 
1790 
1791  if (!params._recognizer_ini_file.empty() && !params._recognizer_config.config_filepath.empty())
1792  throw pbio::Error(0xb3fe4d07, "Error: 0xed877a99 You must use either recognizer_config or recognizer_ini_file.");
1793 
1794  pbio::FacerecService::Config recognizer_config =
1795  params._recognizer_ini_file.empty() ?
1796  params._recognizer_config :
1797  pbio::FacerecService::Config(params._recognizer_ini_file);
1798 
1799  std::vector<char const*> rec_overridden_keys;
1800  std::vector<double> rec_overridden_values;
1801 
1802  recognizer_config.prepare(rec_overridden_keys, rec_overridden_values);
1803 
1804  void* exception = NULL;
1805 
1806  pbio::facerec::VideoWorkerImpl* const vw_impl =
1807  _dll_handle->FacerecService_createVideoWorker_sti_age_gender_emotions(
1808  _impl,
1809 
1810  VideoWorker::STrackingCallback,
1811  VideoWorker::STemplateCreatedCallback,
1812  VideoWorker::SMatchFoundCallback,
1813  VideoWorker::STrackingLostCallback,
1814  VideoWorker::SStiPersonOutdatedCallback,
1815 
1816  (_facerec_conf_dir + params._video_worker_config.config_filepath).c_str(),
1817  vw_overridden_keys.size(),
1818  vw_overridden_keys.empty() ? NULL : &(vw_overridden_keys[0]),
1819  vw_overridden_values.empty() ? NULL : &(vw_overridden_values[0]),
1820 
1821  (_facerec_conf_dir + recognizer_config.config_filepath).c_str(),
1822  rec_overridden_keys.size(),
1823  rec_overridden_keys.empty() ? NULL : &(rec_overridden_keys[0]),
1824  rec_overridden_values.empty() ? NULL : &(rec_overridden_values[0]),
1825 
1826  params._streams_count,
1827  params._processing_threads_count,
1828  params._matching_threads_count,
1829  params._short_time_identification_enabled,
1830  params._short_time_identification_distance_threshold,
1831  params._short_time_identification_outdate_time_seconds,
1832  params._age_gender_estimation_threads_count,
1833  params._emotions_estimation_threads_count,
1834  &exception);
1835 
1836  checkException(exception, *_dll_handle);
1837 
1838  return VideoWorker::Ptr::make(_dll_handle, vw_impl);
1839 }
1840 
1841 
1842 inline
1843 RawSample::Ptr FacerecService::loadRawSample(std::istream &binary_stream) const
1844 {
1845  pbio::stl_wraps::WrapIStreamImpl binary_stream_wrap(binary_stream);
1846 
1847  return loadRawSample(binary_stream_wrap);
1848 }
1849 
1850 inline
1851 RawSample::Ptr FacerecService::loadRawSample(pbio::stl_wraps::WrapIStream &binary_stream) const
1852 {
1853  void* exception = NULL;
1854 
1855  pbio::facerec::RawSampleImpl* const raw_sampl_impl =
1856  _dll_handle->FacerecService_loadRawSample(
1857  _impl,
1858  &binary_stream,
1859  pbio::stl_wraps::WrapIStream::read_func,
1860  &exception);
1861 
1862  checkException(exception, *_dll_handle);
1863 
1864  return RawSample::Ptr::make(_dll_handle, raw_sampl_impl);
1865 }
1866 
1867 inline
1869  pbio::stl_wraps::WrapIStream &binary_stream,
1870  const RawImage image,
1871  const double space_translation_x,
1872  const double space_translation_y,
1873  const double space_scale) const
1874 {
1875  void* exception = NULL;
1876 
1877  const RawImage::CapiData cdata = image.makeCapiData();
1878 
1879  pbio::facerec::RawSampleImpl* const raw_sampl_impl =
1880  _dll_handle->FacerecService_loadRawSampleWithoutImage_raw_image(
1881  _impl,
1882  &binary_stream,
1883  pbio::stl_wraps::WrapIStream::read_func,
1884 
1885  cdata.data,
1886  cdata.width,
1887  cdata.height,
1888  cdata.format,
1889  cdata.with_crop,
1890  cdata.crop_info_offset_x,
1891  cdata.crop_info_offset_y,
1892  cdata.crop_info_data_image_width,
1893  cdata.crop_info_data_image_height,
1894 
1895  space_translation_x,
1896  space_translation_y,
1897  space_scale,
1898 
1899  &exception);
1900 
1901  checkException(exception, *_dll_handle);
1902 
1903  return RawSample::Ptr::make(_dll_handle, raw_sampl_impl);
1904 }
1905 
1906 inline
1908  std::istream &binary_stream,
1909  const RawImage image,
1910  const double space_translation_x,
1911  const double space_translation_y,
1912  const double space_scale) const
1913 {
1914  pbio::stl_wraps::WrapIStreamImpl binary_stream_wrap(binary_stream);
1915 
1917  binary_stream_wrap,
1918  image,
1919  space_translation_x,
1920  space_translation_y,
1921  space_scale);
1922 }
1923 
1924 inline
1926  pbio::stl_wraps::WrapIStream &binary_stream,
1927  const unsigned char *image_data,
1928  int image_data_size,
1929  const double space_translation_x,
1930  const double space_translation_y,
1931  const double space_scale) const
1932 {
1933  void* exception = NULL;
1934 
1935  pbio::facerec::RawSampleImpl* const raw_sampl_impl =
1936  _dll_handle->FacerecService_loadRawSampleWithoutImage_encoded_image(
1937  _impl,
1938  &binary_stream,
1939  pbio::stl_wraps::WrapIStream::read_func,
1940 
1941  image_data,
1942  image_data_size,
1943 
1944  space_translation_x,
1945  space_translation_y,
1946  space_scale,
1947 
1948  &exception);
1949 
1950  checkException(exception, *_dll_handle);
1951 
1952  return RawSample::Ptr::make(_dll_handle, raw_sampl_impl);
1953 }
1954 
1955 inline
1957  std::istream &binary_stream,
1958  const unsigned char *image_data,
1959  int image_data_size,
1960  const double space_translation_x,
1961  const double space_translation_y,
1962  const double space_scale) const
1963 {
1964  pbio::stl_wraps::WrapIStreamImpl binary_stream_wrap(binary_stream);
1965 
1966 
1968  binary_stream_wrap,
1969  image_data,
1970  image_data_size,
1971  space_translation_x,
1972  space_translation_y,
1973  space_scale);
1974 }
1975 
1976 
1977 inline
1979 {
1980  void* exception = NULL;
1981 
1982  pbio::facerec::CameraCalibratorImpl* const calibrator_impl =
1983  _dll_handle->FacerecService_createCameraCalibrator(
1984  _impl,
1985  &exception);
1986 
1987  checkException(exception, *_dll_handle);
1988 
1989  return CameraCalibrator::Ptr::make(_dll_handle, calibrator_impl);
1990 }
1991 
1992 
1993 
1994 inline
1996  const std::string ini_file) const
1997 {
1998  const std::string file_path = _facerec_conf_dir + ini_file;
1999 
2000  void* exception = NULL;
2001 
2002  pbio::facerec::DepthLivenessEstimatorImpl* const the_impl =
2003  _dll_handle->FacerecService_createDepthLivenessEstimatorE(
2004  _impl,
2005  file_path.c_str(),
2006  0, // overridden keys size
2007  NULL, // overridden keys
2008  NULL, // overriden values
2009  &exception);
2010 
2011  checkException(exception, *_dll_handle);
2012 
2013  return DepthLivenessEstimator::Ptr::make(_dll_handle, the_impl);
2014 }
2015 
2016 
2017 inline
2019  const pbio::FacerecService::Config config) const
2020 {
2021  const std::string file_path = _facerec_conf_dir + config.config_filepath;
2022 
2023  std::vector<char const*> overridden_keys;
2024  std::vector<double> overridden_values;
2025 
2026  config.prepare(overridden_keys, overridden_values);
2027 
2028  void* exception = NULL;
2029 
2030  pbio::facerec::DepthLivenessEstimatorImpl* const the_impl =
2031  _dll_handle->FacerecService_createDepthLivenessEstimatorE(
2032  _impl,
2033  file_path.c_str(),
2034  overridden_keys.size(),
2035  overridden_keys.empty() ? NULL : &(overridden_keys[0]),
2036  overridden_values.empty() ? NULL : &(overridden_values[0]),
2037  &exception);
2038 
2039  checkException(exception, *_dll_handle);
2040 
2041  return DepthLivenessEstimator::Ptr::make(_dll_handle, the_impl);
2042 }
2043 
2044 inline
2046  const std::string ini_file) const
2047 {
2048  const std::string file_path = _facerec_conf_dir + ini_file;
2049 
2050  void* exception = NULL;
2051 
2052  pbio::facerec::IRLivenessEstimatorImpl* const the_impl =
2053  _dll_handle->FacerecService_createIRLivenessEstimatorE(
2054  _impl,
2055  file_path.c_str(),
2056  0, // overridden keys size
2057  NULL, // overridden keys
2058  NULL, // overriden values
2059  &exception);
2060 
2061  checkException(exception, *_dll_handle);
2062 
2063  return IRLivenessEstimator::Ptr::make(_dll_handle, the_impl);
2064 }
2065 
2066 inline
2068  const pbio::FacerecService::Config config) const
2069 {
2070  const std::string file_path = _facerec_conf_dir + config.config_filepath;
2071 
2072  std::vector<char const*> overridden_keys;
2073  std::vector<double> overridden_values;
2074 
2075  config.prepare(overridden_keys, overridden_values);
2076 
2077  void* exception = NULL;
2078 
2079  pbio::facerec::IRLivenessEstimatorImpl* const the_impl =
2080  _dll_handle->FacerecService_createIRLivenessEstimatorE(
2081  _impl,
2082  file_path.c_str(),
2083  overridden_keys.size(),
2084  overridden_keys.empty() ? NULL : &(overridden_keys[0]),
2085  overridden_values.empty() ? NULL : &(overridden_values[0]),
2086  &exception);
2087 
2088  checkException(exception, *_dll_handle);
2089 
2090  return IRLivenessEstimator::Ptr::make(_dll_handle, the_impl);
2091 }
2092 
2093 inline
2095  const std::string ini_file) const
2096 {
2097  const std::string file_path = _facerec_conf_dir + ini_file;
2098 
2099  void* exception = NULL;
2100 
2101  pbio::facerec::Liveness2DEstimatorImpl* const the_impl =
2102  _dll_handle->FacerecService_createLiveness2DEstimatorE(
2103  _impl,
2104  file_path.c_str(),
2105  0, // overridden keys size
2106  NULL, // overridden keys
2107  NULL, // overriden values
2108  &exception);
2109 
2110  checkException(exception, *_dll_handle);
2111 
2112  return Liveness2DEstimator::Ptr::make(_dll_handle, the_impl);
2113 }
2114 
2115 inline
2117  const pbio::FacerecService::Config config) const
2118 {
2119  const std::string file_path = _facerec_conf_dir + config.config_filepath;
2120 
2121  std::vector<char const*> overridden_keys;
2122  std::vector<double> overridden_values;
2123 
2124  config.prepare(overridden_keys, overridden_values);
2125 
2126  void* exception = NULL;
2127 
2128  pbio::facerec::Liveness2DEstimatorImpl* const the_impl =
2129  _dll_handle->FacerecService_createLiveness2DEstimatorE(
2130  _impl,
2131  file_path.c_str(),
2132  overridden_keys.size(),
2133  overridden_keys.empty() ? NULL : &(overridden_keys[0]),
2134  overridden_values.empty() ? NULL : &(overridden_values[0]),
2135  &exception);
2136 
2137  checkException(exception, *_dll_handle);
2138 
2139  return Liveness2DEstimator::Ptr::make(_dll_handle, the_impl);
2140 }
2141 
2142 inline
2144  const std::string ini_file) const
2145 {
2146  const std::string file_path = _facerec_conf_dir + ini_file;
2147 
2148  void* exception = NULL;
2149 
2150  pbio::facerec::FaceAttributesEstimatorImpl* const the_impl =
2151  _dll_handle->FacerecService_createFaceAttributesEstimator(
2152  _impl,
2153  file_path.c_str(),
2154  0, // overridden keys size
2155  NULL, // overridden keys
2156  NULL, // overriden values
2157  &exception);
2158 
2159  checkException(exception, *_dll_handle);
2160 
2161  return FaceAttributesEstimator::Ptr::make(_dll_handle, the_impl);
2162 }
2163 
2165 
2166 inline
2167 ProcessingUnit::Ptr FacerecService::createProcessingUnit(
2168  const int block_type,
2169  const char* serializedConfig) const
2170 {
2171  return ProcessingUnit::Ptr::make(_dll_handle, block_type, serializedConfig);
2172 }
2173 
2174 #ifndef WITHOUT_PROCESSING_BLOCK
2175 inline Context FacerecService::createContext() const
2176 {
2177  return Context(_dll_handle);
2178 }
2179 
2180 inline Context FacerecService::createContextFromEncodedImage(const uint8_t* data, uint64_t dataSize) const
2181 {
2182  return Context(_dll_handle, data, dataSize);
2183 }
2184 
2185 inline Context FacerecService::createContextFromEncodedImage(const std::vector<uint8_t>& data) const
2186 {
2187  return Context(_dll_handle, data.data(), data.size());
2188 }
2189 
2190 inline Context FacerecService::createContextFromEncodedImage(const std::string& data) const
2191 {
2192  return Context(_dll_handle, reinterpret_cast<const uint8_t*>(data.data()), data.size());
2193 }
2194 
2195 inline Context FacerecService::createContextFromEncodedImage(const std::vector<char>& data) const
2196 {
2197  return Context(_dll_handle, reinterpret_cast<const uint8_t*>(data.data()), data.size());
2198 }
2199 
2200 inline Context FacerecService::createContextFromFrame(uint8_t* data, int32_t width, int32_t height, Context::Format format, int32_t baseAngle) const
2201 {
2202  return Context(_dll_handle, data, width, height, format, baseAngle);
2203 }
2204 
2205 inline Context FacerecService::createContextFromJsonFile(const char* path)
2206 {
2207  return Context(_dll_handle, path);
2208 }
2209 
2210 inline Context FacerecService::createContextFromJsonFile(std::string path)
2211 {
2212  return Context(_dll_handle, path.c_str());
2213 }
2214 
2215 inline ProcessingBlock FacerecService::createProcessingBlock(const Context& config) const
2216 {
2217  return ProcessingBlock(_impl, _dll_handle, config);
2218 }
2219 #endif
2220 
2222 
2223 inline
2225 {
2226  void* exception = NULL;
2227 
2228  void* struct_storage_impl = _dll_handle->FacerecService_getLicenseState(_impl, &exception);
2229 
2230  checkException(exception, *_dll_handle);
2231 
2232  const StructStorage struct_storage(_dll_handle, struct_storage_impl);
2233 
2234  LicenseState result;
2235 
2236  result.online = struct_storage.get_int64(StructStorageFields::license_state_online_t);
2237 
2238  result.android_app_id = (char const*) struct_storage.get_pointer(StructStorageFields::license_state_android_app_id_t);
2239  result.android_serial = (char const*) struct_storage.get_pointer(StructStorageFields::license_state_android_serial_t);
2240  result.ios_app_id = (char const*) struct_storage.get_pointer(StructStorageFields::license_state_ios_app_id_t);
2241  result.hardware_reg = (char const*) struct_storage.get_pointer(StructStorageFields::license_state_hardware_reg_t);
2242 
2243  result.counters.resize( struct_storage.get_int64(
2244  StructStorageFields::license_state_licenses_count_t) );
2245 
2246  for(size_t i = 0; i < result.counters.size(); ++i)
2247  {
2248  result.counters[i].name = (char const*) struct_storage.get_pointer(
2249  (i << 16) | size_t(StructStorageFields::license_state_licenses_names_int16_t) );
2250 
2251  result.counters[i].max_value = struct_storage.get_int64(
2252  (i << 16) | size_t(StructStorageFields::license_state_licenses_total_counts_int16_t) );
2253 
2254  result.counters[i].value = struct_storage.get_int64(
2255  (i << 16) | size_t(StructStorageFields::license_state_licenses_in_use_counts_int16_t) );
2256  }
2257 
2258  return result;
2259 }
2260 
2261 
2262 inline
2264 {
2265  void* exception = NULL;
2266 
2267  _dll_handle->FacerecService_toggleAlgorithmsCacheKepp(1, &exception);
2268 
2269  checkException(exception, *_dll_handle);
2270 }
2271 
2272 inline
2274 {
2275  void* exception = NULL;
2276 
2277  _dll_handle->FacerecService_toggleAlgorithmsCacheKepp(0, &exception);
2278 
2279  checkException(exception, *_dll_handle);
2280 }
2281 
2282 
2283 
2284 inline
2286  const int width,
2287  const int height,
2288  const RawImage::Format format)
2289 {
2290  void* exception = NULL;
2291 
2292  int32_t data_size;
2293  void* data_ptr;
2294  void* imagetptr_ptr;
2295 
2296  void* const the_impl = _dll_handle->InternalImageBuffer_constructor(
2297  width,
2298  height,
2299  format,
2300  &data_size,
2301  &data_ptr,
2302  &imagetptr_ptr,
2303  &exception);
2304 
2305  checkException(exception, *_dll_handle);
2306 
2307  return InternalImageBuffer::Ptr::make(
2308  _dll_handle,
2309  the_impl,
2310  (unsigned char*) data_ptr,
2311  data_size,
2312  width,
2313  height,
2314  format,
2315  imagetptr_ptr);
2316 }
2317 
2318 
2319 #ifdef ANDROID
2320 inline
2322  JNIEnv *env,
2323  jobject android_media_image)
2324 {
2325  void* exception = NULL;
2326 
2327  int32_t width;
2328  int32_t height;
2329  int32_t format;
2330  int32_t data_size;
2331  void* data_ptr;
2332  void* imagetptr_ptr;
2333 
2334  void* const the_impl = _dll_handle->InternalImageBuffer_constructor_from_android_image(
2335  env,
2336  android_media_image,
2337  &width,
2338  &height,
2339  &format,
2340  &data_size,
2341  &data_ptr,
2342  &imagetptr_ptr,
2343  &exception);
2344 
2345  checkException(exception, *_dll_handle);
2346 
2347  return InternalImageBuffer::Ptr::make(
2348  _dll_handle,
2349  the_impl,
2350  (unsigned char*) data_ptr,
2351  data_size,
2352  width,
2353  height,
2354  (InternalImageBuffer::Format) format,
2355  imagetptr_ptr);
2356 }
2357 #endif
2358 
2359 inline
2361  const RawImage image,
2362  const bool downscale_x2,
2363  void* const result_buffer)
2364 {
2365  void* exception = NULL;
2366 
2367  const RawImage::CapiData cdata = image.makeCapiData();
2368 
2369  _dll_handle->RawImage_convertYUV2ARGB(
2370  cdata.data,
2371  cdata.width,
2372  cdata.height,
2373  cdata.format,
2374  cdata.with_crop,
2375  cdata.crop_info_offset_x,
2376  cdata.crop_info_offset_y,
2377  cdata.crop_info_data_image_width,
2378  cdata.crop_info_data_image_height,
2379  downscale_x2,
2380  result_buffer,
2381  &exception);
2382 
2383  checkException(exception, *_dll_handle);
2384 }
2385 
2386 inline
2387 void FacerecService::convertYUV2RGB(
2388  const RawImage image,
2389  const bool downscale_x2,
2390  const int base_angle,
2391  void* const result_buffer)
2392 {
2393  void* exception = NULL;
2394 
2395  const RawImage::CapiData cdata = image.makeCapiData();
2396 
2397  _dll_handle->RawImage_convertYUV2RGB(
2398  cdata.data,
2399  cdata.width,
2400  cdata.height,
2401  cdata.format,
2402  cdata.with_crop,
2403  cdata.crop_info_offset_x,
2404  cdata.crop_info_offset_y,
2405  cdata.crop_info_data_image_width,
2406  cdata.crop_info_data_image_height,
2407  downscale_x2,
2408  base_angle,
2409  result_buffer,
2410  &exception);
2411 
2412  checkException(exception, *_dll_handle);
2413 }
2414 
2415 inline
2416 void FacerecService::convertBGRA88882RGB(
2417  const RawImage image,
2418  const bool downscale_x2,
2419  const int base_angle,
2420  void* const result_buffer)
2421 {
2422  void* exception = NULL;
2423 
2424  const RawImage::CapiData cdata = image.makeCapiData();
2425 
2426  _dll_handle->RawImage_convertYUV2RGB(
2427  cdata.data,
2428  cdata.width,
2429  cdata.height,
2430  cdata.format,
2431  cdata.with_crop,
2432  cdata.crop_info_offset_x,
2433  cdata.crop_info_offset_y,
2434  cdata.crop_info_data_image_width,
2435  cdata.crop_info_data_image_height,
2436  downscale_x2,
2437  base_angle,
2438  result_buffer,
2439  &exception);
2440 
2441  checkException(exception, *_dll_handle);
2442 }
2443 
2444 
2445 } // pbio namespace
2446 
2447 
2448 
2449 
2450 
2451 #endif // __PBIO_API__PBIO__FACEREC_SERVICE_H_
Интерфейсный объект для взаимодействия с методами из Processing Block API.
Definition: ProcessingBlock.h:29
std::string android_serial
Серийный номер Android-устройства. Доступен только на Android (тэг <android_serial>).
Definition: FacerecService.h:141
void keepAlgorithmsCache() const
Включить удержание данных для алгоритмов в памяти, даже если не осталось владельцев. Это ускорит повторную инициализацию алгоритмов. Потокобезопасный.
Definition: FacerecService.h:2263
Структура, предоставляющая данные изображения в "сыром" формате и опциональную информацию для обрезки...
Definition: RawImage.h:28
Интерфейсный объект для создания других интерфейсных объектов.
Definition: FacerecService.h:64
Context - интерфейсный объект для хранения данных и взаимодействия с методами из Processing Block API...
QualityEstimator - Интерфейсный объект для определения качества образца лица.
VideoWorker - интерфейсный объект для трекинга, обработки и распознавания лиц на нескольких видеопото...
LightSmartPtr< InternalImageBuffer >::tPtr Ptr
Псевдоним для типа умного указателя на InternalImageBuffer.
Definition: InternalImageBuffer.h:34
CameraCalibrator - Интерфейсный объект для калибровки камеры и коррекции дисторсии.
RawSample::Ptr loadRawSample(std::istream &binary_stream) const
Загрузить объект RawSample, сохраненный с помощью метода RawSample::save. Формат платформонезависимый...
Definition: FacerecService.h:1843
static FacerecService::Ptr createService(const std::string dll_path, std::string facerec_conf_dir, const std::string license_dir=std::string())
Инициализировать работу с библиотекой libfacerec (нельзя вызывать более одного раза).
Definition: FacerecService.h:1417
LightSmartPtr< EmotionsEstimator >::tPtr Ptr
Псевдоним для типа умного указателя на EmotionsEstimator.
Definition: EmotionsEstimator.h:50
Recognizer - Интерфейсный объект для создания и сравнения шаблонов.
int64_t max_value
Максимальное значение счетчика (совпадает со значением тэга).
Definition: FacerecService.h:115
Статус счетчика, назначенного определенному элементу лицензии.
Definition: FacerecService.h:103
std::string android_app_id
ID Android приложения. Доступен только на Android (тэг <android_app_id>).
Definition: FacerecService.h:135
LightSmartPtr< IRLivenessEstimator >::tPtr Ptr
Псевдоним для типа умного указателя на IRLivenessEstimator.
Definition: IRLivenessEstimator.h:43
LightSmartPtr< FaceQualityEstimator >::tPtr Ptr
Псевдоним для типа умного указателя на FaceQualityEstimator.
Definition: FaceQualityEstimator.h:50
LightSmartPtr< VideoWorker >::tPtr Ptr
Псевдоним для типа умного указателя на VideoWorker.
Definition: VideoWorker.h:72
Liveness2DEstimator - интерфейсный объект для определения принадлежности лица реальному человеку...
Capturer - Интерфейсный объект для детекции и трекинга лиц на изображениях или видеопоследовательност...
LightSmartPtr< CameraCalibrator >::tPtr Ptr
Псевдоним для типа умного указателя на CameraCalibrator.
Definition: CameraCalibrator.h:48
LightSmartPtr< Capturer >::tPtr Ptr
Псевдоним для типа умного указателя на Capturer.
Definition: Capturer.h:45
Параметры конструктора VideoWorker.
Definition: VideoWorker.h:89
DepthLivenessEstimator - Интерфейсный объект для определения принадлежности лица реальному человеку...
EmotionsEstimator - интерфейсный объект для определения эмоций.
Класс для переопределения параметров конфигурации во время выполнения.
Definition: Config.h:19
IRLivenessEstimator::Ptr createIRLivenessEstimator(const std::string ini_file) const
Создать объект IRLivenessEstimator. Потокобезопасный.
Definition: FacerecService.h:2045
LightSmartPtr< RawSample >::tPtr Ptr
Псевдоним для типа умного указателя на RawSample.
Definition: RawSample.h:58
LightSmartPtr< QualityEstimator >::tPtr Ptr
Псевдоним для типа умного указателя на QualityEstimator.
Definition: QualityEstimator.h:50
FaceQualityEstimator::Ptr createFaceQualityEstimator(const std::string ini_file) const
Создать объект FaceQualityEstimator. Потокобезопасный.
Definition: FacerecService.h:1608
Error - класс исключений, выбрасываемых при возникновении ошибок.
Template - Интерфейсный объект для сохранения шаблона лица.
RawSample - Интерфейсный объект, хранящий образец лица.
CameraCalibrator::Ptr createCameraCalibrator() const
Создать объект CameraCalibrator. Потокобезопасный.
Definition: FacerecService.h:1978
LivenessEstimator - Интерфейсный объект для определения принадлежности лица реальному человеку...
Liveness2DEstimator::Ptr createLiveness2DEstimator(const std::string ini_file) const
Создать объект Liveness2DEstimator. Потокобезопасный.
Definition: FacerecService.h:2094
AgeGenderEstimator - интерфейсный объект для определения пола и возраста
EmotionsEstimator::Ptr createEmotionsEstimator(const std::string ini_file) const
Создать объект EmotionsEstimator. Потокобезопасный.
Definition: FacerecService.h:1642
const std::string license_body
Содержимое лицензии.
Definition: FacerecService.h:87
std::vector< CounterState > counters
Статус всех счетчиков лицензии.
Definition: FacerecService.h:159
LightSmartPtr< Recognizer >::tPtr Ptr
Псевдоним для типа умного указателя на Recognizer.
Definition: Recognizer.h:46
InternalImageBuffer::Ptr createInternalImageBuffer(const int width, const int height, const RawImage::Format format)
Создать InternalImageBuffer для указанного размера и формата изображения. Потокобезопасный. Всегда создавайте новый InternalImageBuffer для каждого изображения или кадра видео. Никогда не изменяйте данные изображения после первого использования.
Definition: FacerecService.h:2285
LightSmartPtr< FacerecService >::tPtr Ptr
Псевдоним для типа умного указателя на FacerecService.
Definition: FacerecService.h:73
Класс исключений, выбрасываемых при возникновении ошибок.
Definition: Error.h:26
std::string ios_app_id
ID iOS приложения. Доступен только на iOS (тэг <ios_app_id>).
Definition: FacerecService.h:147
Capturer::Ptr createCapturer(const pbio::FacerecService::Config config) const
Создать объект Capturer. Тип и возможности зависят от указанного конфигурационного файла...
Definition: FacerecService.h:1543
VideoWorker::Ptr createVideoWorker(const pbio::VideoWorker::Params params) const
Создать объект VideoWorker. Потокобезопасный. Если при создании VideoWorker указаны параметры matchi...
Definition: FacerecService.h:1762
Главный заголовочный файл библиотеки
Recognizer::Ptr createRecognizer(const char *ini_file, const bool processing=true, const bool matching=true, const bool processing_less_memory_consumption=false) const
Создать объект Recognizer. Потокобезопасный.
Definition: FacerecService.h:1662
std::string hardware_reg
Ключ оборудования (тэг <Reg>).
Definition: FacerecService.h:153
void forceOnlineLicenseUpdate() const
Принудительно обновить онлайн-лицензию.
Definition: FacerecService.h:1531
LicenseState getLicenseState() const
Получить статус лицензии. Потокобезопасный.
Definition: FacerecService.h:2224
DepthLivenessEstimator::Ptr createDepthLivenessEstimator(const std::string ini_file) const
Создать объект DepthLivenessEstimator. Потокобезопасный.
Definition: FacerecService.h:1995
bool online
Флаг онлайн-лицензии.
Definition: FacerecService.h:128
int64_t value
Текущее значение (количество используемых элементов).
Definition: FacerecService.h:121
std::string name
Имя элемента (совпадает с именем тэга).
Definition: FacerecService.h:109
Хранение лицензии в виде строковой переменной.
Definition: FacerecService.h:81
FaceAttributesEstimator - интерфейсный объект для определения аттрибутов лица.
AgeGenderEstimator::Ptr createAgeGenderEstimator(const std::string ini_file) const
Создать объект AgeGenderEstimator. Потокобезопасный.
Definition: FacerecService.h:1570
Context - интерфейсный объект для хранения данных и взаимодействия с методами из Processing Block API...
Definition: Context.h:52
LightSmartPtr< Liveness2DEstimator >::tPtr Ptr
Псевдоним для типа умного указателя на Liveness2DEstimator.
Definition: Liveness2DEstimator.h:50
SmartPtr.
void freeAlgorithmsCache() const
Отключить удержание данных для алгоритмов в памяти. Потокобезопасный.
Definition: FacerecService.h:2273
IRLivenessEstimator - интерфейсный объект для определения принадлежности лица реальному человеку...
std::string getVersion() const
Получить версию библиотеки. Потокобезопасный.
Definition: FacerecService.h:1512
LightSmartPtr< FaceAttributesEstimator >::tPtr Ptr
Псевдоним для типа умного указателя на FaceAttributesEstimator.
Definition: FaceAttributesEstimator.h:37
FaceAttributesEstimator::Ptr createFaceAttributesEstimator(const std::string ini_file) const
Создать объект FaceAttributesEstimator. Потокобезопасный.
Definition: FacerecService.h:2143
LightSmartPtr< LivenessEstimator >::tPtr Ptr
Псевдоним для типа умного указателя на LivenessEstimator.
Definition: LivenessEstimator.h:42
Format
Формат данных изображения.
Definition: IRawImage.h:46
LightSmartPtr< AgeGenderEstimator >::tPtr Ptr
Псевдоним для типа умного указателя на AgeGenderEstimator.
Definition: AgeGenderEstimator.h:55
CheckType
Тип проверки для активной (сценарной) оценки принадлежности лица живому человеку. ...
Definition: ActiveLiveness.h:14
void convertYUV2ARGB(const RawImage image, const bool downscale_x2, void *const result_buffer)
Конвертировать входное изображение в формат android.graphics.Bitmap.Config.ARGB_8888. Формат входного изображения должен быть YUV_NV21 или YUV_NV12. Замечание: в действительности порядок байт BGRA, а название ARGB_8888 похоже предполагает нотацию 32-битного little-endian целого числа. Потокобезопасный.
Definition: FacerecService.h:2360
RawSample::Ptr loadRawSampleWithoutImage(pbio::stl_wraps::WrapIStream &binary_stream, const RawImage image, const double space_translation_x=0, const double space_translation_y=0, const double space_scale=1) const
Загрузить объект RawSample, сохраненный с помощью метода RawSample::saveWithoutImage. В случае, если над изображением была выполнена трансформация, вы можете указать параметры преобразования пространства координат: (x, y) -> ( (x + space_translation_x) * space_scale, (y + space_translation_y) * space_scale ) которое будет применено к информации о позиции лица. Заметьте, что параметры одного и того же преобразования нужно передавать только один раз - либо при сериализации, либо при десериализации, иначе преобразование будет применено дважды, что неверно. Формат платформонезависимый. Потокобезопасный.
Definition: FacerecService.h:1868
QualityEstimator::Ptr createQualityEstimator(const std::string ini_file) const
Создать объект QualityEstimator. Потокобезопасный.
Definition: FacerecService.h:1589
FaceQualityEstimator - Интерфейсный объект для определения качества образца лица. ...
Статус лицензии.
Definition: FacerecService.h:97
LivenessEstimator::Ptr createLivenessEstimator() const
Создать объект LivenessEstimator. Потокобезопасный.
Definition: FacerecService.h:1626
LightSmartPtr< DepthLivenessEstimator >::tPtr Ptr
Псевдоним для типа умного указателя на DepthLivenessEstimator.
Definition: DepthLivenessEstimator.h:43