![]() |
SmartFace Embedded Toolkit
4.2.1
|
File containing API of sfe_core library as part of SFE Toolkit. More...
Go to the source code of this file.
Data Structures | |
| struct | SFEImage |
| Raw owned raster image representation, HWC|BGR order. More... | |
| struct | SFEImageInfo |
| Image information structure, for describing image format and size. More... | |
| struct | SFESolverParameter |
| Solver parameter used to configure solvers. More... | |
| struct | SFEEntity |
| Entity type, used to group templates for entity identification. This type is compatible with uuid_v4 that can be used to generate unique ids. More... | |
| struct | SFETemplateIdentificationCandidate |
| Candidate for identification by template. More... | |
| struct | SFEEntityIdentificationCandidate |
| Candidate for identification by entity. More... | |
| struct | SFETracked |
| Tracked entity struct. More... | |
Typedefs | |
| typedef enum SFEHwidMethod | SFEHwidMethod |
| Supported methods for Hardware ID (HWID) computation. | |
| typedef enum SFELicenseType | SFELicenseType |
| License types. | |
| typedef enum SFEImageFormat | SFEImageFormat |
| Supported image formats. | |
| typedef struct SFEImage | SFEImage |
| Raw owned raster image representation, HWC|BGR order. | |
| typedef SFEImage | SFEImageView |
| Raw raster image view, HWC|BGR order. | |
| typedef struct SFEImageInfo | SFEImageInfo |
| Image information structure, for describing image format and size. | |
| typedef void * | SFEError |
| Error type used to hold optional error message. | |
| typedef void * | SFESolver |
| Solver provides an abstract interface over inference models and engines. | |
| typedef struct SFESolverParameter | SFESolverParameter |
| Solver parameter used to configure solvers. | |
| typedef struct SFEEntity | SFEEntity |
| Entity type, used to group templates for entity identification. This type is compatible with uuid_v4 that can be used to generate unique ids. | |
| typedef struct SFETemplateIdentificationCandidate | SFETemplateIdentificationCandidate |
| Candidate for identification by template. | |
| typedef struct SFEEntityIdentificationCandidate | SFEEntityIdentificationCandidate |
| Candidate for identification by entity. | |
| typedef void * | SFETracker |
| Tracker is a ByteTrack implementation for multi-modal tracking across multiple frames. | |
| typedef struct SFETracked | SFETracked |
| Tracked entity struct. | |
Functions | |
| const char *const | sfeVersion () |
| Get version of the toolkit library. | |
| void | sfeErrorFree (SFEError error) |
Free memory associated with SFEError. | |
| const char * | sfeErrorMessage (SFEError error) |
| Get error message. | |
| SFEError | sfeHwidGet (char *out_hwid, size_t *in_out_hwid_len, SFEHwidMethod method) |
| Get Hardware ID (HWID) of the current machine. | |
| SFEError | sfeLicenseValidate (void) |
| Validate a license for this product. This process conducts checks to confirm the license's validity for this product and the current machine. Upon successful validation, the product is ready for use. | |
| SFEError | sfeLicenseType (SFELicenseType *out_license_type) |
| Get license type. This function returns the type of license that is currently active without performing full license validation. | |
| void | sfeLicenseSet (const unsigned char *data, const size_t data_len) |
| Set the license data via environment variable. The environment variable that will be set: ILICENSE_DATA. The provided data will be converted into a base64 string internally since the ILICENSE_DATA environment variable expects data in this format. | |
| SFEError | sfeSolverCreate (const char *solver_file, const SFESolverParameter *solver_parameters, size_t solver_parameters_count, SFESolver *out_solver) |
| Create new solver from solver file. | |
| void | sfeSolverFree (SFESolver solver) |
Free memory associated with SFESolver. | |
| SFEError | sfeImageDecode (const unsigned char *data, size_t data_len, SFEImage *out_image) |
Decode SFEImage from raw image data of various formats. Eg. PNG, JPEG .. | |
| SFEError | sfeImageEncode (SFEImageView image, SFEImageFormat image_format, unsigned char *out_data, size_t *in_out_data_len) |
Encode SFEImage into a buffer with specified image_format. | |
| SFEError | sfeImageInfo (const unsigned char *data, size_t data_len, SFEImageInfo *out_image_info) |
| Try to get information from image data without fully decoding it. | |
| void | sfeImageFree (SFEImage image) |
Free memory associated with SFEImage. | |
| SFEError | sfeImageColorTranspose (SFEImageView image, SFEImage *out_image) |
| Transpose RGB<->BGR color channel order. | |
| SFEError | sfeImageResize (SFEImageView image, size_t width, size_t height, SFEImage *out_image) |
| Resize image. | |
| SFEError | sfeImageResizeWithAspectRatio (SFEImageView image, size_t width, size_t height, SFEImage *out_image) |
| Resize image with maintaining aspect ratio. Whole resized image will be fitted and centered inside output image with black edges. | |
| SFEError | sfeDetect (SFESolver solver, SFEImageView image, float threshold, SFEDetection *out_detections, size_t *in_out_detection_count) |
| Detect objects in the source image using unified detection API. | |
| SFEError | sfeDetectionTrackerCreate (float new_track_threshold, float track_high_threshold, float track_low_threshold, float match_threshold, uint64_t max_time_lost, SFETracker *out_tracker) |
| Create a new tracker. | |
| void | sfeDetectionTrackerFree (SFETracker tracker) |
| Free the tracker. | |
| SFEError | sfeDetectionTrackerUpdate (SFETracker tracker, const SFEDetection *detections, size_t detections_count, SFETracked *out_tracked, size_t *in_out_tracked_count) |
| Update the tracker. | |
| SFEError | sfeDetectionTrackerLost (SFETracker tracker, SFEEntity *out_entities, size_t *in_out_entities_count) |
| Get lost entities after update. | |
| SFEError | sfeDetectionTrackerRemoved (SFETracker tracker, SFEEntity *out_entities, size_t *in_out_entities_count) |
| Get removed entities after update. | |
File containing API of sfe_core library as part of SFE Toolkit.
Definition in file sfe_core.h.
Entity type, used to group templates for entity identification. This type is compatible with uuid_v4 that can be used to generate unique ids.
| typedef struct SFEEntityIdentificationCandidate SFEEntityIdentificationCandidate |
Candidate for identification by entity.
| typedef void* SFEError |
Error type used to hold optional error message.
sfeErrorFree to release memory associated with returned errors. Definition at line 97 of file sfe_core.h.
| typedef enum SFEHwidMethod SFEHwidMethod |
Supported methods for Hardware ID (HWID) computation.
Raw owned raster image representation, HWC|BGR order.
SFEImageView. sfeImageFree to free the allocated image data. | typedef enum SFEImageFormat SFEImageFormat |
Supported image formats.
| typedef struct SFEImageInfo SFEImageInfo |
Image information structure, for describing image format and size.
| typedef SFEImage SFEImageView |
Raw raster image view, HWC|BGR order.
SFEImage. Definition at line 81 of file sfe_core.h.
| typedef enum SFELicenseType SFELicenseType |
License types.
| typedef void* SFESolver |
Solver provides an abstract interface over inference models and engines.
sfeSolverFree to release memory associated with the solver. Definition at line 102 of file sfe_core.h.
| typedef struct SFESolverParameter SFESolverParameter |
Solver parameter used to configure solvers.
Candidate for identification by template.
| typedef struct SFETracked SFETracked |
Tracked entity struct.
| typedef void* SFETracker |
Tracker is a ByteTrack implementation for multi-modal tracking across multiple frames.
sfeDetectionTrackerFree to release memory associated with the tracker. Definition at line 286 of file sfe_core.h.
| enum SFEHwidMethod |
Supported methods for Hardware ID (HWID) computation.
Definition at line 21 of file sfe_core.h.
| enum SFEImageFormat |
Supported image formats.
Definition at line 51 of file sfe_core.h.
| enum SFELicenseType |
License types.
Definition at line 37 of file sfe_core.h.
| enum SFETrackedState |
Tracked state.
| Enumerator | |
|---|---|
| SFE_TRACKED_STATE_NEW | |
| SFE_TRACKED_STATE_TRACKED | |
| SFE_TRACKED_STATE_LOST | |
| SFE_TRACKED_STATE_REMOVED | |
Definition at line 289 of file sfe_core.h.
| SFEError sfeDetect | ( | SFESolver | solver, |
| SFEImageView | image, | ||
| float | threshold, | ||
| SFEDetection * | out_detections, | ||
| size_t * | in_out_detection_count | ||
| ) |
Detect objects in the source image using unified detection API.
| [in] | solver | Detection solver (can be face, iris, palm, object, tattoo, or person solver) |
| [in] | image | Source image |
| [in] | threshold | Detection confidence threshold - range <0,1> |
| [out] | out_detections | Pointer to an array of detected objects |
| [in,out] | in_out_detection_count | IN: maximum number of detections to return OUT: real number of detected objects |
| SFEError sfeDetectionTrackerCreate | ( | float | new_track_threshold, |
| float | track_high_threshold, | ||
| float | track_low_threshold, | ||
| float | match_threshold, | ||
| uint64_t | max_time_lost, | ||
| SFETracker * | out_tracker | ||
| ) |
Create a new tracker.
| [in] | new_track_threshold | Minimum confidence score required to initialize a new track |
| [in] | track_high_threshold | High threshold for tracking |
| [in] | track_low_threshold | Low threshold for tracking |
| [in] | match_threshold | Match threshold |
| [in] | max_time_lost | Maximum time lost |
| [out] | out_tracker | OUT: pointer to the created tracker |
| void sfeDetectionTrackerFree | ( | SFETracker | tracker | ) |
| SFEError sfeDetectionTrackerLost | ( | SFETracker | tracker, |
| SFEEntity * | out_entities, | ||
| size_t * | in_out_entities_count | ||
| ) |
Get lost entities after update.
| [in] | tracker | Tracker to get lost entities from |
| [out] | out_entities | OUT: pointer to the array of lost entities |
| [in,out] | in_out_entities_count | IN: Available space in out_entities OUT: number of lost entities |
| SFEError sfeDetectionTrackerRemoved | ( | SFETracker | tracker, |
| SFEEntity * | out_entities, | ||
| size_t * | in_out_entities_count | ||
| ) |
Get removed entities after update.
| [in] | tracker | Tracker to get removed entities from |
| [out] | out_entities | OUT: pointer to the array of removed entities |
| [in,out] | in_out_entities_count | IN: Available space in out_entities OUT: number of removed entities |
| SFEError sfeDetectionTrackerUpdate | ( | SFETracker | tracker, |
| const SFEDetection * | detections, | ||
| size_t | detections_count, | ||
| SFETracked * | out_tracked, | ||
| size_t * | in_out_tracked_count | ||
| ) |
Update the tracker.
| [in] | tracker | Tracker to update |
| [in] | detections | Detections to update the tracker with (can be NULL if detections_count is 0) |
| [in] | detections_count | Number of detections |
| [out] | out_tracked | OUT: pointer to the array of tracked entities (can be NULL if only count is needed) |
| [in,out] | in_out_tracked_count | IN: Available space in out_tracked (if out_tracked is not NULL) OUT: Number of tracked entities. Can be NULL if out_tracked is NULL. |
| void sfeErrorFree | ( | SFEError | error | ) |
Free memory associated with SFEError.
| [in] | error | Error to free. |
| const char * sfeErrorMessage | ( | SFEError | error | ) |
Get error message.
| [in] | error | Error to get message from. |
sfeErrorFree was not called for the given error. | SFEError sfeHwidGet | ( | char * | out_hwid, |
| size_t * | in_out_hwid_len, | ||
| SFEHwidMethod | method | ||
| ) |
Get Hardware ID (HWID) of the current machine.
SFE_HWID_METHOD_AUTO that will choose a default method for the current platform. | [out] | out_hwid | Pointer to a buffer where the HWID will be stored. Providing a null pointer will determine the necessary buffer size. |
| [in,out] | in_out_hwid_len | IN: Total size of the out_hwid buffer. OUT: Actual size of the data written to the out_hwid buffer. |
| [in] | method | A method to use for HWID computation. |
| SFEError sfeImageColorTranspose | ( | SFEImageView | image, |
| SFEImage * | out_image | ||
| ) |
Transpose RGB<->BGR color channel order.
| [in] | image | Image to color transpose. |
| [out] | out_image | Output image with transposed color channels. |
Decode SFEImage from raw image data of various formats. Eg. PNG, JPEG ..
| [in] | data | Image data to decode image from. |
| [in] | data_len | Size of the image data in bytes. |
| [out] | out_image | Raw raster image. |
SFEImage retains ownership of the image data, call sfeImageFree to release the associated memory. | SFEError sfeImageEncode | ( | SFEImageView | image, |
| SFEImageFormat | image_format, | ||
| unsigned char * | out_data, | ||
| size_t * | in_out_data_len | ||
| ) |
Encode SFEImage into a buffer with specified image_format.
| [in] | image | Image to encode. |
| [in] | image_format | Image format to encode to. |
| [out] | out_data | Image data to encode image into. |
| [in,out] | in_out_data_len | IN: Total size of the out_data buffer. OUT: Actual size of the data written to the buffer. |
| void sfeImageFree | ( | SFEImage | image | ) |
Free memory associated with SFEImage.
| [in] | image | Image to free. |
| SFEError sfeImageInfo | ( | const unsigned char * | data, |
| size_t | data_len, | ||
| SFEImageInfo * | out_image_info | ||
| ) |
Try to get information from image data without fully decoding it.
| [in] | data | Image data to get information from. |
| [in] | data_len | Size of the image data in bytes. |
| [out] | out_image_info | Image information structure. |
| SFEError sfeImageResize | ( | SFEImageView | image, |
| size_t | width, | ||
| size_t | height, | ||
| SFEImage * | out_image | ||
| ) |
Resize image.
| [in] | image | Source image view to resize. |
| [in] | width | Target resize width. |
| [in] | height | Target resize height. |
| [out] | out_image | Resized image. |
| SFEError sfeImageResizeWithAspectRatio | ( | SFEImageView | image, |
| size_t | width, | ||
| size_t | height, | ||
| SFEImage * | out_image | ||
| ) |
Resize image with maintaining aspect ratio. Whole resized image will be fitted and centered inside output image with black edges.
| [in] | image | Source image view to resize. |
| [in] | width | Target resize width. |
| [in] | height | Target resize height. |
| [out] | out_image | Resized image. |
| void sfeLicenseSet | ( | const unsigned char * | data, |
| const size_t | data_len | ||
| ) |
Set the license data via environment variable. The environment variable that will be set: ILICENSE_DATA. The provided data will be converted into a base64 string internally since the ILICENSE_DATA environment variable expects data in this format.
| [in] | data | License data. |
| [in] | data_len | Length of the license data. |
| SFEError sfeLicenseType | ( | SFELicenseType * | out_license_type | ) |
Get license type. This function returns the type of license that is currently active without performing full license validation.
| [out] | out_license_type | Pointer to a SFELicenseType to receive the license type. |
| SFEError sfeLicenseValidate | ( | void | ) |
Validate a license for this product. This process conducts checks to confirm the license's validity for this product and the current machine. Upon successful validation, the product is ready for use.
sfeLicenseType() to get the license type after validation. | SFEError sfeSolverCreate | ( | const char * | solver_file, |
| const SFESolverParameter * | solver_parameters, | ||
| size_t | solver_parameters_count, | ||
| SFESolver * | out_solver | ||
| ) |
Create new solver from solver file.
| [in] | solver_file | Solver file to create the solver from. |
| [in] | solver_parameters | Pointer to collection of solver parameters. |
| [in] | solver_parameters_count | Number of solver parameters. |
| [out] | out_solver | New solver. |
| void sfeSolverFree | ( | SFESolver | solver | ) |
Free memory associated with SFESolver.
| [in] | solver | Solver to free. |
| const char *const sfeVersion | ( | ) |
Get version of the toolkit library.