3DiVi Face SDK
3.21.0
|
VideoWorker is an interface object for tracking, processing and matching faces on multiple video streams. We recommend you to use VideoWorker instead of Capturer for face tracking on video streams. When VideoWorker is created with matching_thread=0 and processing_thread=0, then the standard Capturer license is used. More...
Classes | |
class | DatabaseElement |
Database element. If you have several face templates for one person, you should create one element for each template with the same person_id but different element_id. More... | |
interface | MatchFoundCallback |
Callback function type for a MatchFound event. More... | |
interface | MatchFoundCallbackU |
Callback function type for a MatchFound event. More... | |
class | Params |
Parameters of the VideoWorker constructor. More... | |
class | SearchResult |
Template search result (for the VideoWorker.MatchFoundCallback). More... | |
interface | StiPersonOutdatedCallbackU |
Callback function type for an StiPersonOutdated event. More... | |
interface | TemplateCreatedCallback |
Callback function type for a TemplateCreated event. More... | |
interface | TemplateCreatedCallbackU |
Callback function type for a TemplateCreated event. More... | |
interface | TrackingCallback |
Callback function type for a Tracking event. More... | |
interface | TrackingCallbackU |
Callback function type for a Tracking event. This callback is called every time the frame has been processed by the tracker. Tracking callback will be called with frame_id = X not earlier than VideoWorker.addVideoFrame returns the value X + N - 1, where N is the value returned by VideoWorker.getTrackingConveyorSize. More... | |
interface | TrackingLostCallback |
Callback function type for a TrackingLost event (e.g. when a person leaves the frame). More... | |
interface | TrackingLostCallbackU |
Callback function type for a TrackingLost event (e.g. when a person leaves the frame). More... | |
Public Member Functions | |
void | dispose () |
Release internal object. | |
boolean | isDisposed () |
Check if an object is released. More... | |
String | getMethodName () |
Get a method name of the recognizer used. Thread-safe. More... | |
int | getStreamsCount () |
Get a number of video streams. Thread-safe. More... | |
int | getTrackingConveyorSize (final int stream_id) |
Get a size N of tracking conveyor. Tracking callback will be called with frame_id = X not earlier than VideoWorker.addVideoFrame returns the value X + N - 1, where N is the value returned by VideoWorker.getTrackingConveyorSize. Thread-safe. More... | |
void | setDatabase (final Vector< DatabaseElement > elements, final Recognizer.SearchAccelerationType acceleration) |
Set / replace the database (can be called at any time). Available only if matching_threads_count > 0. Thread-safe. More... | |
int | addVideoFrame (final RawImage frame, final int stream_id) |
Add a new video frame for a specific video stream. Tracking and recognition results will be returned asynchronously via Tracking, MatchFound and TrackingLost callbacks. Thread-safe. More... | |
int | addVideoFrame (final RawImage frame, final int stream_id, final long timestamp_microsec) |
void | addDepthFrame (final DepthMapRaw depth_frame, final int stream_id, final long timestamp_microsec) |
void | addIRFrame (final IRFrameRaw ir_frame, final int stream_id, final long timestamp_microsec) |
void | resetTrackerOnStream (final int stream_id) |
Reset tracker state for a specified video stream. Thread-safe. More... | |
int | resetStream (final int stream_id) |
Reset work state for the stream. It waits for the callbacks, which are currently being executed, therefore, do not synchronize the resetStream call with the code inside the callbacks, otherwise it can cause a deadlock. After resetStream is executed, no callbacks related to the previous frames or tracks will be called. It is necessary to release the memory allocated for all tracks with track_id less than the return value, since there will be no TrackingLost callback for the tracks removed during this reset. Thread-safe. More... | |
void | checkExceptions () |
Exceptions from the callbacks and inner threads are rethrown when this method is called. Thread-safe. | |
synchronized int | addTrackingCallbackU (final TrackingCallbackU callback) |
Add a handler for a Tracking event. Thread-safe. More... | |
synchronized int | addTrackingCallback (final TrackingCallback callback) |
Add a handler for a Tracking event. Thread-safe. More... | |
synchronized int | addTemplateCreatedCallbackU (final TemplateCreatedCallbackU callback) |
Add a handler for a TemplateCreated event. Thread-safe. More... | |
synchronized int | addTemplateCreatedCallback (final TemplateCreatedCallback callback) |
Add a handler for a TemplateCreated event. Thread-safe. More... | |
synchronized int | addMatchFoundCallbackU (final MatchFoundCallbackU callback) |
Add a handler for a MatchFound event. Thread-safe. More... | |
synchronized int | addMatchFoundCallback (final MatchFoundCallback callback) |
Add a handler for a MatchFound event. Thread-safe. More... | |
synchronized int | addTrackingLostCallbackU (final TrackingLostCallbackU callback) |
Add a handler for a TrackingLost event. Thread-safe. More... | |
synchronized int | addTrackingLostCallback (final TrackingLostCallback callback) |
Add a handler for a TrackingLost event. Thread-safe. More... | |
synchronized int | addStiPersonOutdatedCallbackU (final StiPersonOutdatedCallbackU callback) |
Add a handler for an StiPersonOutdated event. Thread-safe. More... | |
synchronized void | removeTrackingCallback (final int callback_id) |
Remove a handler from Tracking event. Thread-safe. More... | |
synchronized void | removeTemplateCreatedCallback (final int callback_id) |
Remove a handler from TemplateCreated event. Thread-safe. More... | |
synchronized void | removeMatchFoundCallback (final int callback_id) |
Remove a handler from MatchFound event. Thread-safe. More... | |
synchronized void | removeTrackingLostCallback (final int callback_id) |
Remove a handler from TrackingLost event. Thread-safe. More... | |
synchronized void | removeStiPersonOutdatedCallback (final int callback_id) |
Remove a handler for an StiPersonOutdated event. Thread-safe. More... | |
void | disableProcessingOnStream (final int stream_id) |
Disable the creation of templates for a given stream. After that, the matching stops as well. Thread-safe. More... | |
void | enableProcessingOnStream (final int stream_id) |
Enable the creation of templates for a given stream. After that, the matching is resumed as well. Thread-safe. More... | |
void | disableAgeGenderEstimationOnStream (final int stream_id) |
Disable age and gender estimation for a given stream. Thread-safe. More... | |
void | enableAgeGenderEstimationOnStream (final int stream_id) |
Enable age and gender estimation for a given stream. Thread-safe. More... | |
void | disableEmotionsEstimationOnStream (final int stream_id) |
Disable estimation of emotions for a given stream. Thread-safe. More... | |
void | enableEmotionsEstimationOnStream (final int stream_id) |
Enable estimation of emotions for a given stream. Thread-safe. More... | |
Static Public Attributes | |
static final long | MATCH_NOT_FOUND_ID = Long.MAX_VALUE |
A special value for the person_id and element_id parameters in the MatchFoundCallback. | |
VideoWorker is an interface object for tracking, processing and matching faces on multiple video streams. We recommend you to use VideoWorker instead of Capturer for face tracking on video streams. When VideoWorker is created with matching_thread=0 and processing_thread=0, then the standard Capturer license is used.
|
inline |
Add a handler for a MatchFound event. Thread-safe.
[in] | callback | Callback function. |
|
inline |
Add a handler for a MatchFound event. Thread-safe.
[in] | callback | Callback function. |
|
inline |
Add a handler for an StiPersonOutdated event. Thread-safe.
[in] | callback | Callback function. |
|
inline |
Add a handler for a TemplateCreated event. Thread-safe.
[in] | callback | Callback function. |
|
inline |
Add a handler for a TemplateCreated event. Thread-safe.
[in] | callback | Callback function. |
|
inline |
Add a handler for a Tracking event. Thread-safe.
[in] | callback | Callback function. |
|
inline |
Add a handler for a Tracking event. Thread-safe.
[in] | callback | Callback function. |
|
inline |
Add a handler for a TrackingLost event. Thread-safe.
[in] | callback | Callback function. |
|
inline |
Add a handler for a TrackingLost event. Thread-safe.
[in] | callback | Callback function. |
|
inline |
Add a new video frame for a specific video stream. Tracking and recognition results will be returned asynchronously via Tracking, MatchFound and TrackingLost callbacks. Thread-safe.
[in] | frame | Video frame. Only colored images are allowed (i.e. RawImage.Format.FORMAT_RGB, RawImage.Format.FORMAT_BGR, RawImage.Format.FORMAT_YUV_NV21 and RawImage.Format.FORMAT_YUV_NV12). |
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
|
inline |
Disable age and gender estimation for a given stream. Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
|
inline |
Disable estimation of emotions for a given stream. Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
|
inline |
Disable the creation of templates for a given stream. After that, the matching stops as well. Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
|
inline |
Enable age and gender estimation for a given stream. Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
|
inline |
Enable estimation of emotions for a given stream. Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
|
inline |
Enable the creation of templates for a given stream. After that, the matching is resumed as well. Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
|
inline |
Get a method name of the recognizer used. Thread-safe.
|
inline |
Get a number of video streams. Thread-safe.
|
inline |
Get a size N of tracking conveyor. Tracking callback will be called with frame_id = X not earlier than VideoWorker.addVideoFrame returns the value X + N - 1, where N is the value returned by VideoWorker.getTrackingConveyorSize. Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
|
inline |
Check if an object is released.
|
inline |
Remove a handler from MatchFound event. Thread-safe.
[in] | callback_id | Integer callback id returned by VideoWorker.addMatchFoundCallback or VideoWorker.addMatchFoundCallbackExt. |
|
inline |
Remove a handler for an StiPersonOutdated event. Thread-safe.
[in] | callback_id | Integer callback id returned by VideoWorker.addStiPersonOutdatedCallbackU. |
|
inline |
Remove a handler from TemplateCreated event. Thread-safe.
[in] | callback_id | Integer callback id returned by VideoWorker.addTemplateCreatedCallback. |
|
inline |
Remove a handler from Tracking event. Thread-safe.
[in] | callback_id | Integer callback id returned by VideoWorker.addTrackingCallback. |
|
inline |
Remove a handler from TrackingLost event. Thread-safe.
[in] | callback_id | Integer callback id returned by VideoWorker.addTrackingLostCallback. |
|
inline |
Reset work state for the stream. It waits for the callbacks, which are currently being executed, therefore, do not synchronize the resetStream call with the code inside the callbacks, otherwise it can cause a deadlock. After resetStream is executed, no callbacks related to the previous frames or tracks will be called. It is necessary to release the memory allocated for all tracks with track_id less than the return value, since there will be no TrackingLost callback for the tracks removed during this reset. Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
|
inline |
Reset tracker state for a specified video stream. Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
|
inline |
Set / replace the database (can be called at any time). Available only if matching_threads_count > 0. Thread-safe.
[in] | elements | Vector of database elements. |
[in] | acceleration | Acceleration type. |