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

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

#include "sfe_core.h"

Go to the source code of this file.

Data Structures

struct  SFETattooTemplate
 Tattoo template struct. More...
 
struct  SFETattooTemplateVersion
 Tattoo template version struct. More...
 

Macros

#define SFE_TATTOO_TEMPLATE_SIZE   522
 Tattoo template size in bytes.
 

Typedefs

typedef struct SFETattooTemplate SFETattooTemplate
 Tattoo template struct.
 
typedef struct SFETattooTemplateVersion SFETattooTemplateVersion
 Tattoo template version struct.
 

Functions

SFEError sfeTattooTemplateExtract (SFESolver solver, SFEImageView image, const SFEDetection *detection, SFETattooTemplate *out_tattoo_template)
 Extract template from source image and given tattoo detection.
 
SFEError sfeTattooTemplateMatch (const SFETattooTemplate *template1, const SFETattooTemplate *template2, float *out_matching_score)
 Match two tattoo templates.
 
SFEError sfeTattooTemplateVersion (const SFETattooTemplate *tattoo_template, SFETattooTemplateVersion *out_tattoo_template_version)
 Get tattoo template version.
 
SFEError sfeTattooTemplateIdentify (const SFETattooTemplate *probe_tattoo_template, const SFETattooTemplate *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 sfeTattooEntityIdentify (const SFETattooTemplate *probe_tattoo_template, const SFETattooTemplate *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 sfeTattooTemplateExport (const SFETattooTemplate *tattoo_template, uint8_t *bytes, size_t *size)
 Export tattoo template to bytes that can be shared between Innovatrics components. This is version v1 of the template format.
 
SFEError sfeTattooTemplateImport (const uint8_t *bytes, size_t size, SFETattooTemplate *out_tattoo_template)
 Import tattoo template from bytes that can be shared between Innovatrics components.
 

Detailed Description

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

Author
Innovatrics - SmartFace Embedded
Date
28.10.2024

Definition in file sfe_tattoo.h.

Macro Definition Documentation

◆ SFE_TATTOO_TEMPLATE_SIZE

#define SFE_TATTOO_TEMPLATE_SIZE   522

Tattoo template size in bytes.

Definition at line 19 of file sfe_tattoo.h.

Typedef Documentation

◆ SFETattooTemplate

Tattoo template struct.

◆ SFETattooTemplateVersion

Tattoo template version struct.

Function Documentation

◆ sfeTattooEntityIdentify()

SFEError sfeTattooEntityIdentify ( const SFETattooTemplate *  probe_tattoo_template,
const SFETattooTemplate *  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_tattoo_templateprobe template
[in]templates_gallerypointer to an array of SFETattooTemplate
[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.

◆ sfeTattooTemplateExport()

SFEError sfeTattooTemplateExport ( const SFETattooTemplate *  tattoo_template,
uint8_t *  bytes,
size_t *  size 
)

Export tattoo template to bytes that can be shared between Innovatrics components. This is version v1 of the template format.

Parameters
[in]tattoo_templatetattoo template to export
[in,out]bytesbytes to export the tattoo template to
[in,out]sizesize of the exported bytes
Returns
Error in case of failed export.

◆ sfeTattooTemplateExtract()

SFEError sfeTattooTemplateExtract ( SFESolver  solver,
SFEImageView  image,
const SFEDetection *  detection,
SFETattooTemplate *  out_tattoo_template 
)

Extract template from source image and given tattoo detection.

Parameters
[in]solvertattoo extraction solver
[in]imagesource image
[in]detectioncore detection containing the detected tattoo
[out]out_tattoo_templateextracted tattoo template
Returns
Error in case of failed extraction.

◆ sfeTattooTemplateIdentify()

SFEError sfeTattooTemplateIdentify ( const SFETattooTemplate *  probe_tattoo_template,
const SFETattooTemplate *  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_tattoo_templateprobe template
[in]templates_gallerypointer to an array of SFETattooTemplate
[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.

◆ sfeTattooTemplateImport()

SFEError sfeTattooTemplateImport ( const uint8_t *  bytes,
size_t  size,
SFETattooTemplate *  out_tattoo_template 
)

Import tattoo template from bytes that can be shared between Innovatrics components.

Parameters
[in]bytesbytes to import the tattoo template from
[in]sizesize of the imported bytes
[out]out_tattoo_templateimported tattoo template
Returns
Error in case of failed import.

◆ sfeTattooTemplateMatch()

SFEError sfeTattooTemplateMatch ( const SFETattooTemplate *  template1,
const SFETattooTemplate *  template2,
float *  out_matching_score 
)

Match two tattoo 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.

◆ sfeTattooTemplateVersion()

SFEError sfeTattooTemplateVersion ( const SFETattooTemplate *  tattoo_template,
SFETattooTemplateVersion *  out_tattoo_template_version 
)

Get tattoo template version.

Parameters
[in]tattoo_templatesource tattoo template
[out]out_tattoo_template_versiontattoo template version struct
Returns
Error in case of template checksum mismatch.