11 #ifndef __PBIO_API__PBIO__VIDEOWORKER_H_
12 #define __PBIO_API__PBIO__VIDEOWORKER_H_
23 #include "ComplexObject.h"
24 #include "deprecated_macro.h"
26 #include "ExceptionCheck.h"
27 #include "RawSample.h"
28 #include "Recognizer.h"
30 #include "stl_wraps_impls/WrapIStreamBufferImpl.h"
31 #include "stl_wraps_impls/WrapIStreamImpl.h"
32 #include "stl_wraps_impls/WrapOStreamImpl.h"
37 #include "DepthMapRaw.h"
39 #include "IRFrameRaw.h"
40 #include "StructStorageFields.h"
41 #include "SampleCheckStatus.h"
43 #include "ActiveLiveness.h"
44 #include "util693bcd72/util.h"
72 typedef LightSmartPtr<VideoWorker>::tPtr
Ptr;
261 const std::vector<RawSample::Ptr> &samples,
262 const std::vector<bool> &samples_weak,
263 const std::vector<float> &samples_quality,
264 void*
const userdata);
566 void*
const userdata);
581 PBIO_API_DEPRECATED_744e321c
585 void*
const userdata);
645 void*
const userdata);
753 void*
const userdata);
768 PBIO_API_DEPRECATED_744e321c
772 void*
const userdata);
847 const uint64_t person_id,
848 const uint64_t element_id,
853 void*
const userdata);
892 const std::vector<SearchResult> &search_result,
893 void*
const userdata);
1060 void*
const userdata);
1075 PBIO_API_DEPRECATED_744e321c
1079 void*
const userdata);
1148 const int stream_id,
1149 const int first_frame_id,
1150 const int last_frame_id,
1151 const float best_quality,
1152 const int best_quality_frame_id,
1155 void*
const userdata);
1328 void*
const userdata);
1345 PBIO_API_DEPRECATED_744e321c
1349 void*
const userdata);
1416 void*
const userdata);
1585 const std::vector<DatabaseElement> &elements,
1638 const int stream_id,
1639 const uint64_t timestamp_microsec = uint64_t(-1));
1675 const int stream_id,
1676 const uint64_t timestamp_microsec);
1712 const int stream_id,
1713 const uint64_t timestamp_microsec);
1834 PBIO_API_DEPRECATED_744e321c
1837 void*
const userdata);
1874 void*
const userdata);
1913 PBIO_API_DEPRECATED_744e321c
1916 void*
const userdata);
1953 void*
const userdata);
1992 PBIO_API_DEPRECATED_744e321c
1995 void*
const userdata);
2035 PBIO_API_DEPRECATED_744e321c
2038 void*
const userdata);
2075 void*
const userdata);
2113 void*
const userdata);
2153 PBIO_API_DEPRECATED_744e321c
2156 void*
const userdata);
2193 void*
const userdata);
2435 const std::string parameter,
2436 const double value);
2443 template<
typename T>
2447 callCallbackFunctor<T, TrackingCallbackData>,
2451 template<
typename T>
2455 callCallbackFunctor<T, TemplateCreatedCallbackData>,
2459 template<
typename T>
2463 callCallbackFunctor<T, MatchFoundCallbackData>,
2467 template<
typename T>
2471 callCallbackFunctor<T, StiPersonOutdatedCallbackData>,
2475 template<
typename T>
2479 callCallbackFunctor<T, TrackingLostCallbackData>,
2485 template<
typename T,
typename DT>
2487 void callCallbackFunctor(
2489 void*
const userdata)
2491 (*
reinterpret_cast<T*
>(userdata))(data);
2497 void STrackingCallback(
2500 void const* callback_data,
2502 const int32_t callbacks_count,
2503 void*
const*
const callbacks_func,
2504 void*
const*
const callbacks_userdata,
2505 const int32_t u_callbacks_count,
2506 void*
const*
const u_callbacks_func,
2507 void*
const*
const u_callbacks_userdata);
2510 void STemplateCreatedCallback(
2513 void const* callback_data,
2515 const int32_t callbacks_count,
2516 void*
const*
const callbacks_func,
2517 void*
const*
const callbacks_userdata,
2518 const int32_t u_callbacks_count,
2519 void*
const*
const u_callbacks_func,
2520 void*
const*
const u_callbacks_userdata);
2523 void SMatchFoundCallback(
2526 void const* callback_data,
2528 const int32_t callbacks_count,
2529 void*
const*
const callbacks_func,
2530 void*
const*
const callbacks_userdata,
2531 const int32_t ext_callbacks_count,
2532 void*
const*
const ext_callbacks_func,
2533 void*
const*
const ext_callbacks_userdata,
2534 const int32_t u_callbacks_count,
2535 void*
const*
const u_callbacks_func,
2536 void*
const*
const u_callbacks_userdata);
2540 void STrackingLostCallback(
2543 void const* callback_data,
2545 const int32_t callbacks_count,
2546 void*
const*
const callbacks_func,
2547 void*
const*
const callbacks_userdata,
2548 const int32_t u_callbacks_count,
2549 void*
const*
const u_callbacks_func,
2550 void*
const*
const u_callbacks_userdata);
2553 void SStiPersonOutdatedCallback(
2556 void const* callback_data,
2558 const int32_t callbacks_count,
2559 void*
const*
const callbacks_func,
2560 void*
const*
const callbacks_userdata);
2563 void toggleSomething(
2564 const int stream_id,
2565 const int something);
2568 const DHPtr &dll_handle,
2572 friend class object_with_ref_counter<
VideoWorker>;
2589 VideoWorker::VideoWorker(
2590 const DHPtr &dll_handle,
2592 ComplexObject(dll_handle, impl)
2594 void* exception = NULL;
2596 _dll_handle->VideoWorker_setThisVW(
2601 checkException(exception, *_dll_handle);
2607 std::ostringstream name_stream;
2608 pbio::stl_wraps::WrapOStreamImpl name_stream_wrap(name_stream);
2610 void* exception = NULL;
2612 _dll_handle->VideoWorker_getMethodName(
2615 pbio::stl_wraps::WrapOStream::write_func,
2618 checkException(exception, *_dll_handle);
2620 return name_stream.str();
2627 void* exception = NULL;
2629 const int result = _dll_handle->VideoWorker_getStreamsCount(
2633 checkException(exception, *_dll_handle);
2642 void* exception = NULL;
2644 const int result = _dll_handle->VideoWorker_getTrackingConveyorSize(
2649 checkException(exception, *_dll_handle);
2657 const std::vector<DatabaseElement> &elements,
2660 std::vector<uint64_t> element_ids_v(elements.size());
2661 std::vector<uint64_t> person_ids_v(elements.size());
2662 std::vector<pbio::facerec::TemplateImpl const*> templates_v(elements.size());
2663 std::vector<float> thresholds_v(elements.size());
2665 for(
size_t i = 0; i < elements.size(); ++i)
2667 element_ids_v[i] = elements[i].element_id;
2668 person_ids_v[i] = elements[i].person_id;
2669 templates_v[i] = (pbio::facerec::TemplateImpl
const*) elements[i].face_template->_impl;
2670 thresholds_v[i] = elements[i].distance_threshold;
2673 void* exception = NULL;
2675 _dll_handle->VideoWorker_setDatabase(
2679 element_ids_v.data(),
2680 person_ids_v.data(),
2682 thresholds_v.data(),
2685 checkException(exception, *_dll_handle);
2691 const int stream_id,
2692 const uint64_t timestamp_microsec)
2694 void* exception = NULL;
2696 const RawImage::CapiData cdata = frame.makeCapiData();
2698 const int result = _dll_handle->VideoWorker_addVideoFrameWithTimestamp_with_crop(
2707 cdata.crop_info_offset_x,
2708 cdata.crop_info_offset_y,
2709 cdata.crop_info_data_image_width,
2710 cdata.crop_info_data_image_height,
2716 checkException(exception, *_dll_handle);
2724 const int stream_id,
2725 const uint64_t timestamp_microsec)
2727 void* exception = NULL;
2729 _dll_handle->VideoWorker_addDepthFrame(
2746 checkException(exception, *_dll_handle);
2752 const int stream_id,
2753 const uint64_t timestamp_microsec)
2755 void* exception = NULL;
2757 _dll_handle->VideoWorker_addIRFrame(
2773 checkException(exception, *_dll_handle);
2779 void* exception = NULL;
2781 _dll_handle->VideoWorker_resetTrackerOnStream(
2786 checkException(exception, *_dll_handle);
2793 void* exception = NULL;
2795 const int threshold_track_id = _dll_handle->VideoWorker_resetStream(
2800 checkException(exception, *_dll_handle);
2802 return threshold_track_id;
2809 void* exception = NULL;
2811 _dll_handle->VideoWorker_checkExceptions(
2815 checkException(exception, *_dll_handle);
2821 void*
const userdata)
2823 void* exception = NULL;
2825 const int result = _dll_handle->VideoWorker_addTrackingCallback(
2827 reinterpret_cast<void*>(callback),
2831 checkException(exception, *_dll_handle);
2839 void*
const userdata)
2841 void* exception = NULL;
2843 const int result = _dll_handle->VideoWorker_addTrackingCallbackU(
2845 reinterpret_cast<void*>(callback),
2849 checkException(exception, *_dll_handle);
2859 void*
const userdata)
2861 void* exception = NULL;
2863 const int result = _dll_handle->VideoWorker_addTemplateCreatedCallback(
2865 reinterpret_cast<void*>(callback),
2869 checkException(exception, *_dll_handle);
2877 void*
const userdata)
2879 void* exception = NULL;
2881 const int result = _dll_handle->VideoWorker_addTemplateCreatedCallbackU(
2883 reinterpret_cast<void*>(callback),
2887 checkException(exception, *_dll_handle);
2896 void*
const userdata)
2898 void* exception = NULL;
2900 const int result = _dll_handle->VideoWorker_addMatchFoundCallback(
2902 reinterpret_cast<void*>(callback),
2906 checkException(exception, *_dll_handle);
2915 void*
const userdata)
2917 void* exception = NULL;
2919 const int result = _dll_handle->VideoWorker_addMatchFoundCallbackExt(
2921 reinterpret_cast<void*>(callback),
2925 checkException(exception, *_dll_handle);
2933 void*
const userdata)
2935 void* exception = NULL;
2937 const int result = _dll_handle->VideoWorker_addMatchFoundCallbackU(
2939 reinterpret_cast<void*>(callback),
2943 checkException(exception, *_dll_handle);
2952 void*
const userdata)
2954 void* exception = NULL;
2956 const int result = _dll_handle->VideoWorker_addTrackingLostCallback(
2958 reinterpret_cast<void*>(callback),
2962 checkException(exception, *_dll_handle);
2970 void*
const userdata)
2972 void* exception = NULL;
2974 const int result = _dll_handle->VideoWorker_addTrackingLostCallbackU(
2976 reinterpret_cast<void*>(callback),
2980 checkException(exception, *_dll_handle);
2988 void*
const userdata)
2990 void* exception = NULL;
2992 const int result = _dll_handle->VideoWorker_addStiPersonOutdatedCallbackU(
2994 reinterpret_cast<void*>(callback),
2998 checkException(exception, *_dll_handle);
3007 const int callback_id)
3009 void* exception = NULL;
3011 _dll_handle->VideoWorker_removeTrackingCallback(
3016 checkException(exception, *_dll_handle);
3021 const int callback_id)
3023 void* exception = NULL;
3025 _dll_handle->VideoWorker_removeTemplateCreatedCallback(
3030 checkException(exception, *_dll_handle);
3035 const int callback_id)
3037 void* exception = NULL;
3039 _dll_handle->VideoWorker_removeMatchFoundCallback(
3044 checkException(exception, *_dll_handle);
3050 const int callback_id)
3052 void* exception = NULL;
3054 _dll_handle->VideoWorker_removeStiPersonOutdatedCallback(
3059 checkException(exception, *_dll_handle);
3064 const int callback_id)
3066 void* exception = NULL;
3068 _dll_handle->VideoWorker_removeTrackingLostCallback(
3073 checkException(exception, *_dll_handle);
3078 #define __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(name) \
3079 catch(const std::exception &e) \
3081 const std::string error = \
3082 "VideoWorker " name " catch std::excetion: '" + \
3083 std::string( e.what() ) + "'."; \
3084 const VideoWorker &this_vw = *reinterpret_cast<VideoWorker const*>(this_vw__); \
3085 this_vw._dll_handle->VideoWorker_errStreamWriteFunc(err_stream, error.c_str(), error.length()); \
3089 const std::string error = "VideoWorker " name " catch '...'."; \
3090 const VideoWorker &this_vw = *reinterpret_cast<VideoWorker const*>(this_vw__); \
3091 this_vw._dll_handle->VideoWorker_errStreamWriteFunc(err_stream, error.c_str(), error.length()); \
3097 void VideoWorker::STrackingCallback(
3100 void const* callback_data,
3102 const int32_t callbacks_count,
3103 void*
const*
const callbacks_func,
3104 void*
const*
const callbacks_userdata,
3105 const int32_t u_callbacks_count,
3106 void*
const*
const u_callbacks_func,
3107 void*
const*
const u_callbacks_userdata)
3113 void* exception = NULL;
3115 const int64_t stream_id = this_vw._dll_handle->StructStorage_get_int64(
3117 StructStorageFields::video_worker_stream_id_t,
3120 checkException(exception, *this_vw._dll_handle);
3122 const int64_t frame_id = this_vw._dll_handle->StructStorage_get_int64(
3124 StructStorageFields::video_worker_frame_id_t,
3127 checkException(exception, *this_vw._dll_handle);
3129 const int64_t samples_count = this_vw._dll_handle->StructStorage_get_int64(
3131 StructStorageFields::video_worker_samples_count_t,
3134 checkException(exception, *this_vw._dll_handle);
3136 pbio::facerec::RawSampleImpl*
const*
const samples_impls =
static_cast<pbio::facerec::RawSampleImpl* const* const
>(
3137 this_vw._dll_handle->StructStorage_get_pointer(
3139 StructStorageFields::video_worker_samples_t,
3142 checkException(exception, *this_vw._dll_handle);
3144 int32_t
const*
const weak_samples =
static_cast<int32_t const* const
>(
3145 this_vw._dll_handle->StructStorage_get_pointer(
3147 pbio::StructStorageFields::video_worker_weak_samples_t,
3150 checkException(exception, *this_vw._dll_handle);
3152 float const*
const samples_quality =
static_cast<float const* const
>(
3153 this_vw._dll_handle->StructStorage_get_pointer(
3155 StructStorageFields::video_worker_samples_quality_t,
3158 checkException(exception, *this_vw._dll_handle);
3160 int32_t
const*
const samples_good_light_and_blur =
static_cast<int32_t const* const
>(
3161 this_vw._dll_handle->StructStorage_get_pointer(
3163 pbio::StructStorageFields::video_worker_good_light_and_blur_samples_t,
3166 checkException(exception, *this_vw._dll_handle);
3168 int32_t
const*
const samples_good_angles =
static_cast<int32_t const* const
>(
3169 this_vw._dll_handle->StructStorage_get_pointer(
3171 pbio::StructStorageFields::video_worker_good_angles_samples_t,
3174 checkException(exception, *this_vw._dll_handle);
3176 int32_t
const*
const samples_good_face_size =
static_cast<int32_t const* const
>(
3177 this_vw._dll_handle->StructStorage_get_pointer(
3179 pbio::StructStorageFields::video_worker_good_face_size_samples_t,
3182 checkException(exception, *this_vw._dll_handle);
3185 int32_t
const*
const samples_detector_confirmed =
static_cast<int32_t const* const
>(
3186 this_vw._dll_handle->StructStorage_get_pointer(
3188 pbio::StructStorageFields::video_worker_detector_confirmed_samples_t,
3191 checkException(exception, *this_vw._dll_handle);
3193 int32_t
const*
const samples_depth_liveness_confirmed =
static_cast<int32_t const* const
>(
3194 this_vw._dll_handle->StructStorage_get_pointer(
3196 pbio::StructStorageFields::video_worker_depth_liveness_confirmed_samples_t,
3199 checkException(exception, *this_vw._dll_handle);
3201 int32_t
const*
const samples_ir_liveness_confirmed =
static_cast<int32_t const* const
>(
3202 this_vw._dll_handle->StructStorage_get_pointer(
3204 pbio::StructStorageFields::video_worker_ir_liveness_confirmed_samples_t,
3207 checkException(exception, *this_vw._dll_handle);
3210 int32_t
const*
const samples_track_age_gender_set =
static_cast<int32_t const* const
>(
3211 this_vw._dll_handle->StructStorage_get_pointer(
3213 pbio::StructStorageFields::video_worker_samples_track_age_gender_set_t,
3215 checkException(exception, *this_vw._dll_handle);
3217 int32_t
const*
const samples_track_gender =
static_cast<int32_t const* const
>(
3218 this_vw._dll_handle->StructStorage_get_pointer(
3220 pbio::StructStorageFields::video_worker_samples_track_gender_t,
3222 checkException(exception, *this_vw._dll_handle);
3224 int32_t
const*
const samples_track_age =
static_cast<int32_t const* const
>(
3225 this_vw._dll_handle->StructStorage_get_pointer(
3227 pbio::StructStorageFields::video_worker_samples_track_age_t,
3229 checkException(exception, *this_vw._dll_handle);
3231 float const*
const samples_track_age_years =
static_cast<float const* const
>(
3232 this_vw._dll_handle->StructStorage_get_pointer(
3234 pbio::StructStorageFields::video_worker_samples_track_age_years_t,
3236 checkException(exception, *this_vw._dll_handle);
3238 int32_t
const*
const samples_track_emotions_set =
static_cast<int32_t const* const
>(
3239 this_vw._dll_handle->StructStorage_get_pointer(
3241 pbio::StructStorageFields::video_worker_samples_track_emotions_set_t,
3243 checkException(exception, *this_vw._dll_handle);
3245 int32_t
const*
const samples_track_emotions_count =
static_cast<int32_t const* const
>(
3246 this_vw._dll_handle->StructStorage_get_pointer(
3248 pbio::StructStorageFields::video_worker_samples_track_emotions_count_t,
3250 checkException(exception, *this_vw._dll_handle);
3252 float const*
const samples_track_emotions_confidence =
static_cast<float const* const
>(
3253 this_vw._dll_handle->StructStorage_get_pointer(
3255 pbio::StructStorageFields::video_worker_samples_track_emotions_confidence_t,
3257 checkException(exception, *this_vw._dll_handle);
3259 int32_t
const*
const samples_track_emotions_emotion =
static_cast<int32_t const* const
>(
3260 this_vw._dll_handle->StructStorage_get_pointer(
3262 pbio::StructStorageFields::video_worker_samples_track_emotions_emotion_t,
3264 checkException(exception, *this_vw._dll_handle);
3266 int32_t
const*
const samples_track_active_liveness_type =
static_cast<int32_t const* const
>(
3267 this_vw._dll_handle->StructStorage_get_pointer(
3269 pbio::StructStorageFields::video_worker_active_liveness_type_samples_t,
3271 checkException(exception, *this_vw._dll_handle);
3273 int32_t
const*
const samples_track_active_liveness_confirmed =
static_cast<int32_t const* const
>(
3274 this_vw._dll_handle->StructStorage_get_pointer(
3276 pbio::StructStorageFields::video_worker_active_liveness_confirmed_samples_t,
3278 checkException(exception, *this_vw._dll_handle);
3280 float const*
const samples_track_active_liveness_progress =
static_cast<float const* const
>(
3281 this_vw._dll_handle->StructStorage_get_pointer(
3283 pbio::StructStorageFields::video_worker_active_liveness_score_samples_t,
3285 checkException(exception, *this_vw._dll_handle);
3290 data.stream_id = stream_id;
3291 data.frame_id = frame_id;
3292 data.samples.resize(samples_count);
3293 data.samples_track_id.resize(samples_count);
3294 data.samples_weak.resize(samples_count);
3295 data.samples_quality.resize(samples_count);
3296 data.samples_good_light_and_blur.resize(samples_count);
3297 data.samples_good_angles.resize(samples_count);
3298 data.samples_good_face_size.resize(samples_count);
3299 data.samples_detector_confirmed.resize(samples_count);
3300 data.samples_depth_liveness_confirmed.resize(samples_count);
3301 data.samples_ir_liveness_confirmed.resize(samples_count);
3302 data.samples_track_age_gender_set.resize(samples_count);
3303 data.samples_track_age_gender.resize(samples_count);
3304 data.samples_track_emotions_set.resize(samples_count);
3305 data.samples_track_emotions.resize(samples_count);
3306 data.samples_active_liveness_status.resize(samples_count);
3308 for(
int i = 0, emotions_i = 0; i < samples_count; ++i)
3310 data.samples[i] =
RawSample::Ptr( RawSample::Ptr::make(this_vw._dll_handle, samples_impls[i]) );
3311 data.samples_track_id[i] = data.samples[i]->getID();
3313 data.samples_weak[i] = weak_samples[i];
3314 data.samples_quality[i] = samples_quality[i];
3326 data.samples_active_liveness_status[i].verdict = (
ActiveLiveness::Liveness)samples_track_active_liveness_confirmed[i];
3327 data.samples_active_liveness_status[i].progress_level = samples_track_active_liveness_progress[i];
3329 data.samples_track_age_gender_set[i] = samples_track_age_gender_set[i];
3333 data.samples_track_age_gender[i].age_years = samples_track_age_years[i];
3335 data.samples_track_emotions_set[i] = samples_track_emotions_set[i];
3337 const int emotions_count = samples_track_emotions_count[i];
3339 for(
int k = 0; k < emotions_count; ++k, ++emotions_i)
3344 ec.
confidence = samples_track_emotions_confidence[emotions_i];
3346 data.samples_track_emotions[i].push_back(ec);
3351 for(
int i = 0; i < u_callbacks_count; ++i)
3358 u_callback_function_i(
3360 u_callbacks_userdata[i]);
3362 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"TrackingCallbackU")
3366 for(
int i = 0; i < callbacks_count; ++i)
3373 callback_function_i(
3378 data.samples_quality,
3379 callbacks_userdata[i]);
3381 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"TrackingCallback")
3384 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"TrackingCallback_")
3392 void VideoWorker::STemplateCreatedCallback(
3395 void const* callback_data,
3397 const int32_t callbacks_count,
3398 void*
const*
const callbacks_func,
3399 void*
const*
const callbacks_userdata,
3400 const int32_t u_callbacks_count,
3401 void*
const*
const u_callbacks_func,
3402 void*
const*
const u_callbacks_userdata)
3408 void* exception = NULL;
3410 const int64_t stream_id = this_vw._dll_handle->StructStorage_get_int64(
3412 StructStorageFields::video_worker_stream_id_t,
3415 checkException(exception, *this_vw._dll_handle);
3417 const int64_t frame_id = this_vw._dll_handle->StructStorage_get_int64(
3419 StructStorageFields::video_worker_frame_id_t,
3422 checkException(exception, *this_vw._dll_handle);
3424 const double quality = this_vw._dll_handle->StructStorage_get_double(
3426 StructStorageFields::video_worker_quality_t,
3429 checkException(exception, *this_vw._dll_handle);
3431 pbio::facerec::RawSampleImpl*
const sample_impl =
static_cast<pbio::facerec::RawSampleImpl* const
>(
3432 this_vw._dll_handle->StructStorage_get_pointer(
3434 StructStorageFields::video_worker_samples_t,
3437 checkException(exception, *this_vw._dll_handle);
3439 pbio::facerec::TemplateImpl*
const templ_impl =
static_cast<pbio::facerec::TemplateImpl* const
>(
3440 this_vw._dll_handle->StructStorage_get_pointer(
3442 StructStorageFields::video_worker_templ_t,
3445 checkException(exception, *this_vw._dll_handle);
3447 const RawSample::Ptr sample( RawSample::Ptr::make(this_vw._dll_handle, sample_impl));
3449 const Template::Ptr templ( Template::Ptr::make(this_vw._dll_handle, templ_impl));
3451 TemplateCreatedCallbackData data;
3453 data.stream_id = stream_id;
3454 data.frame_id = frame_id;
3455 data.quality = quality;
3456 data.sample = sample;
3462 for(
int i = 0; i < u_callbacks_count; ++i)
3469 u_callback_function_i(
3471 u_callbacks_userdata[i]);
3473 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"TemplateCreatedCallbackU")
3478 for(
int i = 0; i < callbacks_count; ++i)
3485 callback_function_i(
3491 callbacks_userdata[i]);
3493 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"TemplateCreatedCallback")
3498 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"TemplateCreatedCallback_")
3507 void VideoWorker::SMatchFoundCallback(
3510 void const* callback_data,
3512 const int32_t callbacks_count,
3513 void*
const*
const callbacks_func,
3514 void*
const*
const callbacks_userdata,
3515 const int32_t ext_callbacks_count,
3516 void*
const*
const ext_callbacks_func,
3517 void*
const*
const ext_callbacks_userdata,
3518 const int32_t u_callbacks_count,
3519 void*
const*
const u_callbacks_func,
3520 void*
const*
const u_callbacks_userdata)
3526 void* exception = NULL;
3528 const int64_t stream_id = this_vw._dll_handle->StructStorage_get_int64(
3530 StructStorageFields::video_worker_stream_id_t,
3533 checkException(exception, *this_vw._dll_handle);
3535 const int64_t frame_id = this_vw._dll_handle->StructStorage_get_int64(
3537 StructStorageFields::video_worker_frame_id_t,
3540 checkException(exception, *this_vw._dll_handle);
3542 const double quality = this_vw._dll_handle->StructStorage_get_double(
3544 StructStorageFields::video_worker_quality_t,
3547 checkException(exception, *this_vw._dll_handle);
3549 pbio::facerec::RawSampleImpl*
const sample_impl =
static_cast<pbio::facerec::RawSampleImpl* const
>(
3550 this_vw._dll_handle->StructStorage_get_pointer(
3552 StructStorageFields::video_worker_samples_t,
3555 checkException(exception, *this_vw._dll_handle);
3557 pbio::facerec::TemplateImpl*
const templ_impl =
static_cast<pbio::facerec::TemplateImpl* const
>(
3558 this_vw._dll_handle->StructStorage_get_pointer(
3560 StructStorageFields::video_worker_templ_t,
3563 checkException(exception, *this_vw._dll_handle);
3565 const int64_t search_result_size = this_vw._dll_handle->StructStorage_get_int64(
3567 StructStorageFields::video_worker_search_result_size_t,
3570 checkException(exception, *this_vw._dll_handle);
3572 uint64_t
const*
const search_result_person_ids =
static_cast<uint64_t const* const
>(
3573 this_vw._dll_handle->StructStorage_get_pointer(
3575 StructStorageFields::video_worker_search_result_person_ids_t,
3578 checkException(exception, *this_vw._dll_handle);
3580 uint64_t
const*
const search_result_element_ids =
static_cast<uint64_t const* const
>(
3581 this_vw._dll_handle->StructStorage_get_pointer(
3583 StructStorageFields::video_worker_search_result_element_ids_t,
3586 checkException(exception, *this_vw._dll_handle);
3588 float const*
const search_result_match_result_distances =
static_cast<float const* const
>(
3589 this_vw._dll_handle->StructStorage_get_pointer(
3591 StructStorageFields::video_worker_search_result_match_result_distance_t,
3594 checkException(exception, *this_vw._dll_handle);
3596 float const*
const search_result_match_result_far_s =
static_cast<float const* const
>(
3597 this_vw._dll_handle->StructStorage_get_pointer(
3599 StructStorageFields::video_worker_search_result_match_result_fa_r_t,
3602 checkException(exception, *this_vw._dll_handle);
3604 float const*
const search_result_match_result_frr_s =
static_cast<float const* const
>(
3605 this_vw._dll_handle->StructStorage_get_pointer(
3607 StructStorageFields::video_worker_search_result_match_result_fr_r_t,
3610 checkException(exception, *this_vw._dll_handle);
3612 float const*
const search_result_match_result_scores =
static_cast<float const* const
>(
3613 this_vw._dll_handle->StructStorage_get_pointer(
3615 StructStorageFields::video_worker_search_result_match_result_score_t,
3618 checkException(exception, *this_vw._dll_handle);
3621 const RawSample::Ptr sample( RawSample::Ptr::make(this_vw._dll_handle, sample_impl));
3623 const Template::Ptr templ( Template::Ptr::make(this_vw._dll_handle, templ_impl));
3625 std::vector<SearchResult> search_results(search_result_size);
3627 for(
int i = 0; i < search_result_size; ++i)
3629 search_results[i].person_id = search_result_person_ids[i];
3630 search_results[i].element_id = search_result_element_ids[i];
3631 search_results[i].match_result.distance = search_result_match_result_distances[i];
3632 search_results[i].match_result.fa_r = search_result_match_result_far_s[i];
3633 search_results[i].match_result.fr_r = search_result_match_result_frr_s[i];
3634 search_results[i].match_result.score = search_result_match_result_scores[i];
3638 data.stream_id = stream_id;
3639 data.frame_id = frame_id;
3640 data.quality = quality;
3641 data.sample = sample;
3643 data.search_results = search_results;
3649 for(
int i = 0; i < u_callbacks_count; ++i)
3656 u_callback_function_i(
3658 u_callbacks_userdata[i]);
3660 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"MatchFoundCallbackU")
3664 for(
int i = 0; i < ext_callbacks_count; ++i)
3671 ext_callback_function_i(
3677 data.search_results,
3678 ext_callbacks_userdata[i]);
3680 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"MatchFoundCallbackExt")
3684 for(
int i = 0; i < callbacks_count; ++i)
3691 callback_function_i(
3694 data.search_results[0].person_id,
3695 data.search_results[0].element_id,
3699 data.search_results[0].match_result,
3700 callbacks_userdata[i]);
3702 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"MatchFoundCallback")
3706 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"MatchFoundCallback_")
3712 void VideoWorker::SStiPersonOutdatedCallback(
3715 void const* callback_data,
3717 const int32_t callbacks_count,
3718 void*
const*
const callbacks_func,
3719 void*
const*
const callbacks_userdata)
3725 void* exception = NULL;
3727 const int64_t stream_id = this_vw._dll_handle->StructStorage_get_int64(
3729 StructStorageFields::video_worker_stream_id_t,
3732 checkException(exception, *this_vw._dll_handle);
3734 const int64_t sti_person_id = this_vw._dll_handle->StructStorage_get_int64(
3736 StructStorageFields::video_worker_sti_person_id_t,
3739 checkException(exception, *this_vw._dll_handle);
3742 StiPersonOutdatedCallbackData data;
3743 data.stream_id = stream_id;
3744 data.sti_person_id = sti_person_id;
3746 for(
int i = 0; i < callbacks_count; ++i)
3753 callback_function_i(
3755 callbacks_userdata[i]);
3757 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"StiPersonOutdated")
3760 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"StiPersonOutdated")
3765 void VideoWorker::STrackingLostCallback(
3768 void const* callback_data,
3770 const int32_t callbacks_count,
3771 void*
const*
const callbacks_func,
3772 void*
const*
const callbacks_userdata,
3773 const int32_t u_callbacks_count,
3774 void*
const*
const u_callbacks_func,
3775 void*
const*
const u_callbacks_userdata)
3781 void* exception = NULL;
3783 const int64_t stream_id = this_vw._dll_handle->StructStorage_get_int64(
3785 StructStorageFields::video_worker_stream_id_t,
3788 checkException(exception, *this_vw._dll_handle);
3790 const int64_t first_frame_id = this_vw._dll_handle->StructStorage_get_int64(
3792 StructStorageFields::video_worker_first_frame_id_t,
3795 checkException(exception, *this_vw._dll_handle);
3797 const int64_t last_frame_id = this_vw._dll_handle->StructStorage_get_int64(
3799 StructStorageFields::video_worker_last_frame_id_t,
3802 checkException(exception, *this_vw._dll_handle);
3804 const double best_quality = this_vw._dll_handle->StructStorage_get_double(
3806 StructStorageFields::video_worker_best_quality_t,
3809 checkException(exception, *this_vw._dll_handle);
3811 const int64_t best_quality_frame_id = this_vw._dll_handle->StructStorage_get_int64(
3813 StructStorageFields::video_worker_best_qaulity_frame_id_t,
3816 checkException(exception, *this_vw._dll_handle);
3818 pbio::facerec::RawSampleImpl*
const best_quality_sample_impl =
static_cast<pbio::facerec::RawSampleImpl* const
>(
3819 this_vw._dll_handle->StructStorage_get_pointer(
3821 StructStorageFields::video_worker_samples_t,
3824 checkException(exception, *this_vw._dll_handle);
3827 best_quality_sample_impl ?
3828 RawSample::Ptr::make(this_vw._dll_handle, best_quality_sample_impl) :
3832 pbio::facerec::TemplateImpl*
const best_quality_template_impl =
static_cast<pbio::facerec::TemplateImpl* const
>(
3833 this_vw._dll_handle->StructStorage_get_pointer(
3835 StructStorageFields::video_worker_templ_t,
3838 checkException(exception, *this_vw._dll_handle);
3841 best_quality_template_impl ?
3842 Template::Ptr( Template::Ptr::make(this_vw._dll_handle, best_quality_template_impl)) :
3846 const int64_t track_id = this_vw._dll_handle->StructStorage_get_int64(
3848 StructStorageFields::video_worker_track_id_t,
3851 checkException(exception, *this_vw._dll_handle);
3854 const int64_t sti_person_id = this_vw._dll_handle->StructStorage_get_int64(
3856 StructStorageFields::video_worker_sti_person_id_t,
3859 checkException(exception, *this_vw._dll_handle);
3862 const bool sti_person_id_set = this_vw._dll_handle->StructStorage_get_int64(
3864 StructStorageFields::video_worker_sti_person_id_set_t,
3867 checkException(exception, *this_vw._dll_handle);
3871 TrackingLostCallbackData data;
3872 data.stream_id = stream_id;
3873 data.first_frame_id = first_frame_id;
3874 data.last_frame_id = last_frame_id;
3875 data.best_quality = best_quality;
3876 data.best_quality_frame_id = best_quality_frame_id;
3877 data.best_quality_sample = sample;
3878 data.best_quality_templ = templ;
3879 data.track_id = track_id;
3880 data.sti_person_id = sti_person_id;
3881 data.sti_person_id_set = sti_person_id_set;
3887 for(
int i = 0; i < u_callbacks_count; ++i)
3894 u_callback_function_i(
3896 u_callbacks_userdata[i]);
3898 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"TrackingLostCallbackU")
3902 for(
int i = 0; i < callbacks_count; ++i)
3909 callback_function_i(
3911 data.first_frame_id,
3914 data.best_quality_frame_id,
3915 data.best_quality_sample,
3916 data.best_quality_templ,
3917 callbacks_userdata[i]);
3919 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"TrackingLostCallback")
3923 __0x6ce24ef9_VideoWorker_static_callback_functions_catch_exceptions(
"TrackingLostCallback_")
3928 void VideoWorker::toggleSomething(
3929 const int stream_id,
3930 const int something)
3932 void* exception = NULL;
3934 _dll_handle->VideoWorker_toggleSomething(
3940 checkException(exception, *_dll_handle);
3947 toggleSomething(stream_id, pbio::facerec::capi::VideoWorker_something_Processing_Disable);
3954 toggleSomething(stream_id, pbio::facerec::capi::VideoWorker_something_Processing_Enable);
3961 toggleSomething(stream_id, pbio::facerec::capi::VideoWorker_something_AgeGender_Disable);
3967 toggleSomething(stream_id, pbio::facerec::capi::VideoWorker_something_AgeGender_Enable);
3973 toggleSomething(stream_id, pbio::facerec::capi::VideoWorker_something_Emotions_Disable);
3979 toggleSomething(stream_id, pbio::facerec::capi::VideoWorker_something_Emotions_Enable);
3987 : _video_worker_config(std::string())
3988 , _recognizer_ini_file()
3989 , _recognizer_config(std::string())
3991 , _processing_threads_count(0)
3992 , _matching_threads_count(0)
3993 , _age_gender_estimation_threads_count(0)
3994 , _emotions_estimation_threads_count(0)
3995 , _short_time_identification_enabled(false)
3996 , _short_time_identification_distance_threshold(0)
3997 , _short_time_identification_outdate_time_seconds(0)
3998 , _active_liveness_checks_order()
4005 void VideoWorker::setParameter(
4006 const std::string parameter,
4009 void* exception = NULL;
4011 _dll_handle->VideoWorker_setParameter(
4017 checkException(exception, *_dll_handle);
4024 #endif // __PBIO_API__PBIO__VIDEOWORKER_H_
int64_t frame_id
Integer id of the frame (that was returned by VideoWorker::addVideoFrame).
Definition: VideoWorker.h:679
float depth_map_2_image_scale_x
Parameter of correspondence between the coordinates of the original image and depth map...
Definition: DepthMapRaw.h:56
void checkExceptions()
Exceptions from the callbacks and inner threads are rethrown when this method is called. Thread-safe.
Definition: VideoWorker.h:2807
int64_t sti_person_id
ID of "sti_person", which is a set of tracks formed by short time identification. sti_person_id is eq...
Definition: VideoWorker.h:1279
Liveness
Estimated liveness.
Definition: IRLivenessEstimator.h:50
int64_t last_frame_id
Integer id of the frame after which the face tracking was lost.
Definition: VideoWorker.h:1197
std::vector< SampleCheckStatus::Verdict > samples_good_angles
The result of checking the sample for absence of too high yaw/pitch angles (samples_good_angles.size() == samples.size())
Definition: VideoWorker.h:394
Struct that provides raw image data and optional cropping information.
Definition: RawImage.h:28
void(* TrackingLostCallbackU)(const TrackingLostCallbackData &data, void *const userdata)
Callback function type for a TrackingLost event (e.g. when a person leaves the frame).
Definition: VideoWorker.h:1326
Template search result (for VideoWorker::MatchFoundCallbackFuncU).
Definition: VideoWorker.h:177
void(* TemplateCreatedCallbackU)(const TemplateCreatedCallbackData &data, void *const userdata)
Callback function type for a TemplateCreated event.
Definition: VideoWorker.h:751
double quality
Face sample quality. The same as from the FaceQualityEstimator.
Definition: VideoWorker.h:949
Liveness
Active liveness check state.
Definition: ActiveLiveness.h:47
float depth_unit_in_millimeters
Scale of values stored in the depth_data.
Definition: DepthMapRaw.h:84
std::vector< float > samples_quality
Quality value for the face sample. The same as from the FaceQualityEstimator (samples_quality.size() == samples.size())
Definition: VideoWorker.h:370
int depth_data_stride_in_bytes
Stride in bytes.
Definition: DepthMapRaw.h:98
float horizontal_fov
The horizontal viewing angle of the depth map in degrees.
Definition: DepthMapRaw.h:70
int depth_map_cols
Width of the depth map.
Definition: DepthMapRaw.h:35
Template::Ptr templ
Template created for this sample.
Definition: VideoWorker.h:711
void setDatabase(const std::vector< DatabaseElement > &elements, const Recognizer::SearchAccelerationType acceleration=Recognizer::SEARCH_ACCELERATION_1)
Set / replace the database (can be called at any time). Available only if matching_threads_count > 0...
Definition: VideoWorker.h:2656
void enableProcessingOnStream(const int stream_id)
Enable the creation of templates for a given stream. After that, the matching is resumed as well...
Definition: VideoWorker.h:3952
Params & short_time_identification_enabled(const bool value)
Set the flag enabling short time identification.
Definition: VideoWorker.h:149
int addTemplateCreatedCallback(const TemplateCreatedCallbackFunc callback, void *const userdata)
Add a handler for a TemplateCreated event. Thread-safe.
Definition: VideoWorker.h:2857
Definition: CallbackData.h:106
int64_t first_frame_id
Integer id of the frame on which the face was first detected.
Definition: VideoWorker.h:1187
int64_t stream_id
Integer id of the video stream (0 <= stream_id < streams_count).
Definition: VideoWorker.h:667
float depth_map_2_image_offset_y
Parameter of correspondence between the coordinates of the original image and depth map...
Definition: DepthMapRaw.h:49
uint64_t element_id
Unique id of the element.
Definition: VideoWorker.h:1443
void resetTrackerOnStream(const int stream_id)
Reset tracker state for a specified video stream. Thread-safe.
Definition: VideoWorker.h:2777
An IR frame aligned with an original color image. Correspondence between the coordinates of the ori...
Definition: IRFrameRaw.h:21
int getTrackingConveyorSize(const int stream_id) const
Get a size N of tracking conveyor. Tracking callback will be called with frame_id = X not earlier tha...
Definition: VideoWorker.h:2640
int addTemplateCreatedCallbackU(const TemplateCreatedCallbackU callback, void *const userdata)
Add a handler for a TemplateCreated event. Thread-safe.
Definition: VideoWorker.h:2875
LightSmartPtr< VideoWorker >::tPtr Ptr
Alias for the type of a smart pointer to VideoWorker.
Definition: VideoWorker.h:72
Heuristically accelerated linear search. Heuristics reduces TAR (true acceptance rate) on the 1:N tes...
Definition: Recognizer.h:143
std::vector< int > samples_track_id
Vector of face IDs (track_id). track_id is equal to sample.getID() for the sample given in any VideoW...
Definition: VideoWorker.h:334
void(* TrackingCallbackFuncU)(const TrackingCallbackData &data, void *const userdata)
Callback function type for a Tracking event.
Definition: VideoWorker.h:583
int64_t stream_id
Integer id of the video stream (0 <= stream_id < streams_count).
Definition: VideoWorker.h:1177
void enableAgeGenderEstimationOnStream(const int stream_id)
Enable age and gender estimation for a given stream. Thread-safe.
Definition: VideoWorker.h:3965
std::vector< SampleCheckStatus::Verdict > samples_detector_confirmed
The result of checking the sample with the frontal face detector (samples_detector_confirmed.size() == samples.size())
Definition: VideoWorker.h:420
std::vector< IRLivenessEstimator::Liveness > samples_ir_liveness_confirmed
The result of checking the sample with IRLivenessEstimator, IR frames are required, see VideoWorker::addIRFrame. See IRLivenessEstimator::Liveness for details. (samples_ir_liveness_confirmed.size() == samples.size())
Definition: VideoWorker.h:452
void enableEmotionsEstimationOnStream(const int stream_id)
Enable estimation of emotions for a given stream. Thread-safe.
Definition: VideoWorker.h:3977
RawSample::Ptr sample
Face sample.
Definition: VideoWorker.h:689
Parameters of the VideoWorker constructor.
Definition: VideoWorker.h:89
LightSmartPtr< Template >::tPtr Ptr
Alias for the type of a smart pointer to Template.
Definition: Template.h:46
std::vector< RawSample::Ptr > samples
Vector of face samples found by the tracker. Most of the samples are received from the frame_id fra...
Definition: VideoWorker.h:320
bool sti_person_id_set
Flag indicating that sti_person_id is set. sti_person_id is not set, if short time identification is ...
Definition: VideoWorker.h:1267
DepthLivenessEstimator - Interface object used to estimate face liveness in order to prevent spoofing...
Age
Age groups.
Definition: AgeGenderEstimator.h:62
Interface object for saving the face template.
Definition: Template.h:13
Verdict
Definition: SampleCheckStatus.h:17
std::vector< ActiveLiveness::ActiveLivenessStatus > samples_active_liveness_status
Face active liveness check status. See ActiveLiveness::ActiveLivenessStatus for details. (samples_active_liveness_status.size() == samples.size())
Definition: VideoWorker.h:516
EmotionsEstimator - Interface object for estimation of emotions.
int addMatchFoundCallbackU(const MatchFoundCallbackU callback, void *const userdata)
Add a handler for a MatchFound event. Thread-safe.
Definition: VideoWorker.h:2931
A class used to override the configuration parameters at runtime.
Definition: Config.h:19
TrackingLost callback data.
Definition: VideoWorker.h:1165
void(* MatchFoundCallbackFunc)(const int stream_id, const int frame_id, const uint64_t person_id, const uint64_t element_id, const RawSample::Ptr &sample, const float quality, const Template::Ptr &templ, const Recognizer::MatchResult match_result, void *const userdata)
Callback function type for a MatchFound event.
Definition: VideoWorker.h:844
float ir_vertical_fov
The vertical viewing angle of an IR frame in degrees.
Definition: IRFrameRaw.h:77
void removeStiPersonOutdatedCallback(const int callback_id)
Remove a handler for an StiPersonOutdated event. Thread-safe.
Definition: VideoWorker.h:3049
LightSmartPtr< RawSample >::tPtr Ptr
Alias for the type of a smart pointer to RawSample.
Definition: RawSample.h:58
Definition: CallbackData.h:150
uint16_t const * ir_frame_data
Pointer to IR data.
Definition: IRFrameRaw.h:84
int getStreamsCount() const
Get a number of video streams. Thread-safe.
Definition: VideoWorker.h:2625
int depth_map_rows
Height of the depth map.
Definition: DepthMapRaw.h:28
void(* MatchFoundCallbackFuncU)(const MatchFoundCallbackData &data, void *const userdata)
Callback function type for a MatchFound event.
Definition: VideoWorker.h:1077
int64_t stream_id
Integer id of the video stream (0 <= stream_id < streams_count).
Definition: VideoWorker.h:286
int resetStream(const int stream_id)
Reset work state for the stream. It waits for the callbacks, which are currently being executed...
Definition: VideoWorker.h:2791
int addStiPersonOutdatedCallbackU(const StiPersonOutdatedCallbackU callback, void *const userdata)
Add a handler for an StiPersonOutdated event. Thread-safe.
Definition: VideoWorker.h:2986
float ir_frame_2_image_offset_x
Parameter of correspondence between the coordinates of an original image and an IR frame...
Definition: IRFrameRaw.h:42
void(* TrackingCallbackU)(const TrackingCallbackData &data, void *const userdata)
Callback function type for a Tracking event. This callback is called every time the frame has been pr...
Definition: VideoWorker.h:564
Error - the class of exceptions thrown when errors occur.
int64_t stream_id
Integer id of the video stream (0 <= stream_id < streams_count).
Definition: VideoWorker.h:1373
VideoWorker is an interface object for tracking, processing and matching faces on multiple video stre...
Definition: VideoWorker.h:63
int addTrackingCallbackU(const TrackingCallbackU callback, void *const userdata)
Add a handler for a Tracking event. Thread-safe.
Definition: VideoWorker.h:2837
AgeGenderEstimator - interface object for age and gender estimation.
Template::Ptr best_quality_templ
Template created from best_quality_sample. Will be NULL if processing_threads_count is zero or best_q...
Definition: VideoWorker.h:1243
SearchAccelerationType
Types of search acceleration.
Definition: Recognizer.h:119
Result of template matching.
Definition: Recognizer.h:53
MatchFound callback data.
Definition: VideoWorker.h:903
Emotion with confidence.
Definition: EmotionsEstimator.h:114
std::vector< EmotionsEstimator::EstimatedEmotionsVector > samples_track_emotions
Estimated emotions for this track. (samples_track_emotions.size() == samples.size()) ...
Definition: VideoWorker.h:500
float ir_horizontal_fov
The horizontal viewing angle of an IR frame in degrees.
Definition: IRFrameRaw.h:70
RawSample::Ptr sample
Face sample.
Definition: VideoWorker.h:937
int64_t frame_id
Integer id of the frame (that was returned by VideoWorker::addVideoFrame).
Definition: VideoWorker.h:927
void disableEmotionsEstimationOnStream(const int stream_id)
Disable estimation of emotions for a given stream. Thread-safe.
Definition: VideoWorker.h:3971
uint64_t person_id
Unique id of the person.
Definition: VideoWorker.h:186
Params & recognizer_ini_file(const std::string value)
Set the name of the configuration file for Recognizer that will be used inside VideoWorker.
Definition: VideoWorker.h:107
Params & matching_threads_count(const int value)
Set the number of threads for matching templates with the database.
Definition: VideoWorker.h:131
void disableProcessingOnStream(const int stream_id)
Disable the creation of templates for a given stream. After that, the matching stops as well...
Definition: VideoWorker.h:3945
float ir_frame_2_image_scale_y
Parameter of correspondence between the coordinates of an original image and an IR frame...
Definition: IRFrameRaw.h:63
Recognizer::MatchResult match_result
Result of template matching.
Definition: VideoWorker.h:202
static const uint64_t MATCH_NOT_FOUND_ID
A special value for the person_id and element_id parameters in the MatchFoundCallback.
Definition: VideoWorker.h:81
Params & processing_threads_count(const int value)
Set the number of threads for creating templates.
Definition: VideoWorker.h:125
std::vector< DepthLivenessEstimator::Liveness > samples_depth_liveness_confirmed
The result of checking the sample with DepthLivenessEstimator, depth frames are required, see VideoWorker::addDepthFrame. See DepthLivenessEstimator::Liveness for details. (samples_depth_liveness_confirmed.size() == samples.size())
Definition: VideoWorker.h:436
std::vector< bool > samples_track_age_gender_set
Flag indicating that age and gender were estimated for this track. (samples_track_age_gender_set.size() == samples.size())
Definition: VideoWorker.h:464
void(* TemplateCreatedCallbackFunc)(const int stream_id, const int frame_id, const RawSample::Ptr &sample, const float quality, const Template::Ptr &templ, void *const userdata)
Callback function type for a TemplateCreated event.
Definition: VideoWorker.h:639
RawSample::Ptr best_quality_sample
The best quality sample from the best_quality_frame_id frame. Will be NULL if "weak_tracks_in_trackin...
Definition: VideoWorker.h:1231
void removeTemplateCreatedCallback(const int callback_id)
Remove a handler for TemplateCreated event. Thread-safe.
Definition: VideoWorker.h:3020
std::vector< SampleCheckStatus::Verdict > samples_good_light_and_blur
The result of checking the sample for good lighting conditions and absence of a strong blur (samples_...
Definition: VideoWorker.h:382
uint64_t element_id
Unique id of the element.
Definition: VideoWorker.h:195
std::vector< AgeGenderEstimator::AgeGender > samples_track_age_gender
Estimated age and gender for this track. (samples_track_age_gender.size() == samples.size())
Definition: VideoWorker.h:476
float confidence
Positive real number in the range of [0; 1].
Definition: EmotionsEstimator.h:128
Emotion emotion
Emotion.
Definition: EmotionsEstimator.h:121
void(* MatchFoundCallbackFuncExt)(const int stream_id, const int frame_id, const RawSample::Ptr &sample, const float quality, const Template::Ptr &templ, const std::vector< SearchResult > &search_result, void *const userdata)
Callback function type for a MatchFound event.
Definition: VideoWorker.h:886
A depth map aligned with the original color image. Correspondence between the coordinates of the or...
Definition: DepthMapRaw.h:21
double quality
Face sample quality. The same as from the FaceQualityEstimator.
Definition: VideoWorker.h:701
Params & age_gender_estimation_threads_count(const int value)
Set the number of threads for age_gender estimation.
Definition: VideoWorker.h:137
Params & active_liveness_checks_order(const std::vector< ActiveLiveness::CheckType > value)
Set the order for checking the active liveness.
Definition: VideoWorker.h:167
Emotion
Emotions.
Definition: EmotionsEstimator.h:57
void(* StiPersonOutdatedCallbackU)(const StiPersonOutdatedCallbackData &data, void *const userdata)
Callback function type for an StiPersonOutdated event.
Definition: VideoWorker.h:1414
void(* TrackingLostCallbackFunc)(const int stream_id, const int first_frame_id, const int last_frame_id, const float best_quality, const int best_quality_frame_id, const RawSample::Ptr &best_quality_sample, const Template::Ptr &best_quality_templ, void *const userdata)
Callback function type for a TrackingLost event (e.g. when a person leaves the frame).
Definition: VideoWorker.h:1147
VideoWorker is an interface object for tracking, processing and matching faces on multiple video stre...
Definition: VideoWorker.h:105
void(* TemplateCreatedCallbackFuncU)(const TemplateCreatedCallbackData &data, void *const userdata)
Callback function type for a TemplateCreated event.
Definition: VideoWorker.h:770
void removeTrackingCallback(const int callback_id)
Remove a handler for Tracking event. Thread-safe.
Definition: VideoWorker.h:3006
float ir_frame_2_image_offset_y
Parameter of correspondence between the coordinates of an original image and an IR frame...
Definition: IRFrameRaw.h:49
int addTrackingLostCallbackU(const TrackingLostCallbackU callback, void *const userdata)
Add a handler for a TrackingLost event. Thread-safe.
Definition: VideoWorker.h:2968
int addMatchFoundCallbackExt(const MatchFoundCallbackFuncExt callback, void *const userdata)
Add a handler for a MatchFound event. Thread-safe.
Definition: VideoWorker.h:2913
TemplateCreated callback data.
Definition: VideoWorker.h:655
Interface object that stores a captured face sample.
Definition: RawSample.h:125
std::vector< SampleCheckStatus::Verdict > samples_good_face_size
The result of checking the sample for suitable face size, see the min_template_generation_face_size p...
Definition: VideoWorker.h:408
int addMatchFoundCallback(const MatchFoundCallbackFunc callback, void *const userdata)
Add a handler for a MatchFound event. Thread-safe.
Definition: VideoWorker.h:2894
Params & video_worker_config(const pbio::Config value)
Set the VideoWorker configuration file with optionally overridden parameters.
Definition: VideoWorker.h:101
int32_t ir_data_stride_in_bytes
Stride in bytes.
Definition: IRFrameRaw.h:91
int ir_frame_cols
Width of an IR frame.
Definition: IRFrameRaw.h:35
void removeTrackingLostCallback(const int callback_id)
Remove a handler for TrackingLost event. Thread-safe.
Definition: VideoWorker.h:3063
float distance_threshold
Distance threshold for a MatchFound event.
Definition: VideoWorker.h:1481
Params & emotions_estimation_threads_count(const int value)
Set the number of threads for estimation of emotions.
Definition: VideoWorker.h:143
int64_t stream_id
Integer id of the video stream (0 <= stream_id < streams_count).
Definition: VideoWorker.h:915
IRLivenessEstimator is an interface object used to estimate face liveness in order to prevent spoofin...
int64_t track_id
ID of the lost face (track_id). track_id is equal to sample.getID() for a sample given in any VideoWo...
Definition: VideoWorker.h:1255
std::vector< bool > samples_weak
Since this is tracking, some samples may be false, so we mark the samples with the "weak" flag if the...
Definition: VideoWorker.h:356
Gender
Gender groups.
Definition: AgeGenderEstimator.h:98
float ir_frame_2_image_scale_x
Parameter of correspondence between the coordinates of an original image and an IR frame...
Definition: IRFrameRaw.h:56
int64_t sti_person_id
ID of "sti_person", which is a set of tracks formed by short time identification. sti_person_id is eq...
Definition: VideoWorker.h:1385
Params & short_time_identification_outdate_time_seconds(const float value)
Set outdate_time in seconds for short time identification.
Definition: VideoWorker.h:161
void disableAgeGenderEstimationOnStream(const int stream_id)
Disable age and gender estimation for a given stream. Thread-safe.
Definition: VideoWorker.h:3959
float depth_map_2_image_scale_y
Parameter of correspondence between the coordinates of the original image and depth map...
Definition: DepthMapRaw.h:63
float depth_map_2_image_offset_x
Parameter of correspondence between the coordinates of the original image and depth map...
Definition: DepthMapRaw.h:42
Definition: FacerecService.mm:79
Database element. If you have several face templates for one person, you should create one element fo...
Definition: VideoWorker.h:1434
float vertical_fov
The vertical viewing angle of the depth map in degrees.
Definition: DepthMapRaw.h:77
StiPersonOutdated callback data.
Definition: VideoWorker.h:1361
void(* MatchFoundCallbackU)(const MatchFoundCallbackData &data, void *const userdata)
Callback function type for a MatchFound event.
Definition: VideoWorker.h:1058
int addVideoFrame(const RawImage frame, const int stream_id, const uint64_t timestamp_microsec=uint64_t(-1))
Add a new video frame for a specific video stream. Tracking and recognition results will be returned ...
Definition: VideoWorker.h:2689
std::vector< SearchResult > search_results
Found elements with a distance less than distance_threshold (but not more than k nearest elements...
Definition: VideoWorker.h:981
double best_quality
Best sample quality over all frames.
Definition: VideoWorker.h:1207
CheckType
Check type for active liveness.
Definition: ActiveLiveness.h:14
int64_t best_quality_frame_id
Integer id of the frame of the best quality.
Definition: VideoWorker.h:1217
uint64_t person_id
Unique id of the person.
Definition: VideoWorker.h:1452
void addIRFrame(const IRFrameRaw &ir_frame, const int stream_id, const uint64_t timestamp_microsec)
Add a new IR frame for a specific stream. Thread-safe.
Definition: VideoWorker.h:2750
Params & streams_count(const int value)
Set the number of video streams.
Definition: VideoWorker.h:119
Tracking callback data.
Definition: VideoWorker.h:274
int addTrackingCallback(const TrackingCallbackFunc callback, void *const userdata)
Add a handler for a Tracking event. Thread-safe.
Definition: VideoWorker.h:2819
void(* TrackingLostCallbackFuncU)(const TrackingLostCallbackData &data, void *const userdata)
Callback function type for a TrackingLost event (e.g. when a person leaves the frame).
Definition: VideoWorker.h:1347
Template::Ptr templ
Template created for this sample.
Definition: VideoWorker.h:959
std::string getMethodName() const
Get a method name of the recognizer used. Thread-safe.
Definition: VideoWorker.h:2605
Params()
Default constructor, set strings to empty, numbers to zero, flags to false.
Definition: VideoWorker.h:3986
void addDepthFrame(const DepthMapRaw &depth_frame, const int stream_id, const uint64_t timestamp_microsec)
Add a new depth frame for a specific stream. Thread-safe.
Definition: VideoWorker.h:2722
int ir_frame_rows
Height of an IR frame.
Definition: IRFrameRaw.h:28
void(* TrackingCallbackFunc)(const int stream_id, const int frame_id, const std::vector< RawSample::Ptr > &samples, const std::vector< bool > &samples_weak, const std::vector< float > &samples_quality, void *const userdata)
Callback function type for a Tracking event.
Definition: VideoWorker.h:258
int64_t frame_id
Integer id of the frame (that was returned by VideoWorker::addVideoFrame).
Definition: VideoWorker.h:298
std::vector< bool > samples_track_emotions_set
Flag indicating that emotions were estimated for this track. (samples_track_emotions_set.size() == samples.size())
Definition: VideoWorker.h:488
int addTrackingLostCallback(const TrackingLostCallbackFunc callback, void *const userdata)
Add a handler for a TrackingLost event. Thread-safe.
Definition: VideoWorker.h:2950
Template::Ptr face_template
Face template.
Definition: VideoWorker.h:1461
Params & short_time_identification_distance_threshold(const float value)
Set the recognition distance threshold for short time identification.
Definition: VideoWorker.h:155
Liveness
Estimated liveness.
Definition: DepthLivenessEstimator.h:50
void removeMatchFoundCallback(const int callback_id)
Remove a handler for MatchFound event. Thread-safe.
Definition: VideoWorker.h:3034
uint16_t const * depth_data
Pointer to the depth raw data.
Definition: DepthMapRaw.h:91
Params & recognizer_config(const pbio::Config value)
Set the Recognizer configuration file with optionally overridden parameters.
Definition: VideoWorker.h:113