SmartFace Embedded Toolkit  4.2.1
Loading...
Searching...
No Matches
sfe_palm.h File Reference

File containing API of sfe_palm library as part of SFE Toolkit. More...

#include "sfe_core.h"

Go to the source code of this file.

Data Structures

struct  SFEPalmTemplate
 Palm template struct. More...
 
struct  SFEPalmTemplateVersion
 Palm template version struct. More...
 
struct  SFEPalmAttributes
 

Macros

#define SFE_PALM_TEMPLATE_SIZE   522
 Palm template size in bytes.
 

Typedefs

typedef struct SFEPalmTemplate SFEPalmTemplate
 Palm template struct.
 
typedef struct SFEPalmTemplateVersion SFEPalmTemplateVersion
 Palm template version struct.
 
typedef struct SFEPalmAttributes SFEPalmAttributes
 

Functions

SFEError sfePalmLandmarks (SFESolver solver, SFEImageView image, const SFEDetection *detection, SFEPalmLandmarks *out_landmarks)
 Calculate palm landmarks from given source image and palm detection.
 
SFEError sfePalmAttributes (SFESolver solver, SFEImageView image, const SFEPalmLandmarks *landmarks, SFEPalmAttributes *out_attributes)
 Calculate palm image quality attributes from given source image and palm detection.
 
SFEError sfePalmTemplateExtract (SFESolver solver, SFEImageView image, const SFEPalmLandmarks *landmarks, SFEPalmTemplate *out_palm_template)
 Extract template from source image and given palm attributes.
 
SFEError sfePalmTemplateMatch (const SFEPalmTemplate *template1, const SFEPalmTemplate *template2, float *out_matching_score)
 Match two palm templates.
 
SFEError sfePalmTemplateVersion (const SFEPalmTemplate *palm_template, SFEPalmTemplateVersion *out_palm_template_version)
 Get palm template version.
 
SFEError sfePalmTemplateIdentify (const SFEPalmTemplate *probe_palm_template, const SFEPalmTemplate *templates_gallery, size_t gallery_size, float matching_score_threshold, SFETemplateIdentificationCandidate *out_candidates, size_t *in_out_candidates_count, size_t thread_count)
 Get an ordered array of SFETemplateIdentificationCandidate from probe's template best matches with templates in the gallery.
 
SFEError sfePalmEntityIdentify (const SFEPalmTemplate *probe_palm_template, const SFEPalmTemplate *templates_gallery, const SFEEntity *entities_gallery, size_t gallery_size, float matching_score_threshold, SFEEntityIdentificationCandidate *out_candidates, size_t *in_out_candidates_count, size_t thread_count)
 Get an ordered array of SFEEntityIdentificationCandidate from probe's template best matches with templates in the gallery. Entity is then used to group the results by entity using the best score of any template associated with the entity.
 
SFEError sfePalmLivenessPassive (SFESolver solver, SFEImageView image, const SFEDetection *detection, float *out_liveness_score)
 Passive liveness score calculation.
 

Detailed Description

File containing API of sfe_palm library as part of SFE Toolkit.

Author
Innovatrics - SmartFace Embedded
Date
28.10.2024

Definition in file sfe_palm.h.

Macro Definition Documentation

◆ SFE_PALM_TEMPLATE_SIZE

#define SFE_PALM_TEMPLATE_SIZE   522

Palm template size in bytes.

Definition at line 19 of file sfe_palm.h.

Typedef Documentation

◆ SFEPalmAttributes

◆ SFEPalmTemplate

Palm template struct.

◆ SFEPalmTemplateVersion

Palm template version struct.

Function Documentation

◆ sfePalmAttributes()

SFEError sfePalmAttributes ( SFESolver  solver,
SFEImageView  image,
const SFEPalmLandmarks *  landmarks,
SFEPalmAttributes *  out_attributes 
)

Calculate palm image quality attributes from given source image and palm detection.

Parameters
[in]solverattributes solver
[in]imagesource image
[in]landmarkspalm landmarks
[out]out_attributesstructure containing hand_orientation, hand_position, quality
Returns
Error in case of failed attributes calculation
Examples
example_palm_attributes.cpp.

◆ sfePalmEntityIdentify()

SFEError sfePalmEntityIdentify ( const SFEPalmTemplate *  probe_palm_template,
const SFEPalmTemplate *  templates_gallery,
const SFEEntity *  entities_gallery,
size_t  gallery_size,
float  matching_score_threshold,
SFEEntityIdentificationCandidate *  out_candidates,
size_t *  in_out_candidates_count,
size_t  thread_count 
)

Get an ordered array of SFEEntityIdentificationCandidate from probe's template best matches with templates in the gallery. Entity is then used to group the results by entity using the best score of any template associated with the entity.

Parameters
[in]probe_palm_templateprobe template
[in]templates_gallerypointer to an array of SFEPalmTemplate
[in]entities_gallerypointer to an array of SFEEntity that corresponds with templates_gallery
[in]gallery_sizenumber of templates in gallery
[in]matching_score_thresholdthreshold for matching - range <0,1>
[out]out_candidatesPointer to an ordered array of candidates
[in,out]in_out_candidates_countIN: Expected number of candidates OUT: Number of found candidates with matching score above the matching score threshold
[in]thread_countNumber of threads to use in the identification - 0: use all available cores, 1: use single thread, N: use N number of threads
Returns
Error in case of failed identification.

◆ sfePalmLandmarks()

SFEError sfePalmLandmarks ( SFESolver  solver,
SFEImageView  image,
const SFEDetection *  detection,
SFEPalmLandmarks *  out_landmarks 
)

Calculate palm landmarks from given source image and palm detection.

Parameters
[in]solverlandmarks solver
[in]imagesource image
[in]detectioncore detection containing the detected palm
[out]out_landmarksstructure containing hand_position, hand_orientation, confidence, and keypoints
Returns
Error in case of failed landmarks calculation
Examples
example_palm_attributes.cpp, and example_palm_identify.cpp.

◆ sfePalmLivenessPassive()

SFEError sfePalmLivenessPassive ( SFESolver  solver,
SFEImageView  image,
const SFEDetection *  detection,
float *  out_liveness_score 
)

Passive liveness score calculation.

Parameters
[in]solverpassive liveness solver
[in]imagesource image
[in]detectioncore detection containing the detected palm
[out]out_liveness_scoreOUT: normalized score of passive liveness
Returns
Error in case of failed passive liveness score calculation
Examples
example_palm_liveness.cpp.

◆ sfePalmTemplateExtract()

SFEError sfePalmTemplateExtract ( SFESolver  solver,
SFEImageView  image,
const SFEPalmLandmarks *  landmarks,
SFEPalmTemplate *  out_palm_template 
)

Extract template from source image and given palm attributes.

Parameters
[in]solverpalm extraction solver
[in]imagesource image
[in]landmarkspalm landmarks
[out]out_palm_templateextracted palm template
Returns
Error in case of failed extraction.
Examples
example_palm_identify.cpp.

◆ sfePalmTemplateIdentify()

SFEError sfePalmTemplateIdentify ( const SFEPalmTemplate *  probe_palm_template,
const SFEPalmTemplate *  templates_gallery,
size_t  gallery_size,
float  matching_score_threshold,
SFETemplateIdentificationCandidate *  out_candidates,
size_t *  in_out_candidates_count,
size_t  thread_count 
)

Get an ordered array of SFETemplateIdentificationCandidate from probe's template best matches with templates in the gallery.

Parameters
[in]probe_palm_templateprobe template
[in]templates_gallerypointer to an array of SFPalmTemplate
[in]gallery_sizenumber of templates in the gallery
[in]matching_score_thresholdthreshold for matching - range <0,1>
[out]out_candidatesPointer to an ordered array of candidates
[in,out]in_out_candidates_countIN: Expected number of candidates OUT: Number of found candidates with matching score above the matching score threshold
[in]thread_countNumber of threads to use in the identification - 0: use all available cores, 1: use single thread, N: use N number of threads
Returns
Error in case of failed identification.
Examples
example_palm_identify.cpp.

◆ sfePalmTemplateMatch()

SFEError sfePalmTemplateMatch ( const SFEPalmTemplate *  template1,
const SFEPalmTemplate *  template2,
float *  out_matching_score 
)

Match two palm templates.

Parameters
[in]template1first template to match
[in]template2second template to match
[out]out_matching_scorematching score - range <0,1>
Returns
Error in case of failed matching.
Examples
example_palm_identify.cpp.

◆ sfePalmTemplateVersion()

SFEError sfePalmTemplateVersion ( const SFEPalmTemplate *  palm_template,
SFEPalmTemplateVersion *  out_palm_template_version 
)

Get palm template version.

Parameters
[in]palm_templatesource palm template
[out]out_palm_template_versionpalm template version struct
Returns
Error in case of template checksum mismatch.
Examples
example_palm_identify.cpp.