Face Engine SDK 5.25.0
A face detection, recognition and tracking engine.
Loading...
Searching...
No Matches
fsdk::IDescriptorMatcher Struct Referenceabstract

Descriptor matcher interface. More...

#include <IDescriptor.h>

Inheritance diagram for fsdk::IDescriptorMatcher:
fsdk::IRefCounted

Public Member Functions

virtual ResultValue< FSDKError, MatchingResultmatch (const IDescriptor *first, const IDescriptor *second) noexcept=0
 Match descriptors 1:1.
 
virtual Result< FSDKErrormatch (const IDescriptor *reference, const IDescriptorBatch *candidates, Span< MatchingResult > results) noexcept=0
 Match descriptors 1:M.
 
virtual uint32_t getModelVersion () const noexcept=0
 Get algorithm model version this matcher works with.
 
virtual Result< FSDKErrorcalcSimilarity (Span< MatchingResult > distances) const noexcept=0
 Calculates similarity based on distance.
 
virtual Result< FSDKErrorcalcDistance (Span< MatchingResult > similarities) const noexcept=0
 Calculates distance from similarity.
 
- Public Member Functions inherited from fsdk::IRefCounted
virtual int32_t retain () noexcept=0
 Increase strong reference count.
 
virtual int32_t retainLocked () noexcept=0
 Increase strong reference count thread safely.
 
virtual int32_t release () noexcept=0
 Decrease strong reference count.
 
virtual int32_t getRefCount () const noexcept=0
 Get actual strong reference count.
 
virtual int32_t retainWeak () noexcept=0
 Increase weak reference count.
 
virtual int32_t releaseWeak () noexcept=0
 Decrease weak reference count.
 
virtual int32_t getWeakRefCount () const noexcept=0
 Get actual weak reference count.
 

Detailed Description

Descriptor matcher interface.

Matches descriptors 1:1 and 1:M (

See also
IDescriptor and IDescriptorBatch interfaces).

As a result of the matching process the calling site gets a MatchingResult (or several of them in case of 1:M matching). The MatchingResult structure contains distance and similarity metrics.

Distance is measured in abstract units and tends to 0 for similar descriptors and to infinity for different ones. Similarity is the opposite metric and shows probability of two descriptors belonging to the same person; therfore it is normalized to [0..1] range.

See also
MatchingResult for details.

Member Function Documentation

◆ calcDistance()

virtual Result< FSDKError > fsdk::IDescriptorMatcher::calcDistance ( Span< MatchingResult > similarities) const
pure virtualnoexcept

Calculates distance from similarity.

The method gets similarity from similarities[i].similarity and assigns the result to similarities[i].distance.

Parameters
[in]similaritiesis a mutable span of matching results with calculated similarity.
Returns
Result with error code.
See also
Span, MatchingResult, Result and FSDKError for details.
Note
all spans should be based on user owned continuous collections.

◆ calcSimilarity()

virtual Result< FSDKError > fsdk::IDescriptorMatcher::calcSimilarity ( Span< MatchingResult > distances) const
pure virtualnoexcept

Calculates similarity based on distance.

The method gets distance from distances[i].distances. and assigns the result to distances[i].similarity.

Parameters
[in]dinstancesis a mutable span of matching results with calculated distances.
Returns
Result with error code.
See also
Span, MatchingResult, Result and FSDKError for details.
Note
all spans should be based on user owned continuous collections.

◆ getModelVersion()

virtual uint32_t fsdk::IDescriptorMatcher::getModelVersion ( ) const
pure virtualnoexcept

Get algorithm model version this matcher works with.

Returns
Version as integral number.

◆ match() [1/2]

virtual ResultValue< FSDKError, MatchingResult > fsdk::IDescriptorMatcher::match ( const IDescriptor * first,
const IDescriptor * second )
pure virtualnoexcept

Match descriptors 1:1.

Parameters
[in]firstfirst descriptor.
[in]secondsecond descriptor.
Returns
ResultValue with error code and matching result.
See also
MatchingResult, IDescriptor, ResultValue and FSDKError for details.

◆ match() [2/2]

virtual Result< FSDKError > fsdk::IDescriptorMatcher::match ( const IDescriptor * reference,
const IDescriptorBatch * candidates,
Span< MatchingResult > results )
pure virtualnoexcept

Match descriptors 1:M.

Matches a reference descriptor to a batch of candidate descriptors. The results are layed out in the same order as the candidate descriptors in the batch.

Parameters
[in]referencethe reference descriptor.
[in]candidatesthe candidate descriptor batch to match with the reference.
[out]resultsspan of matching results.
Note
Length of results must be at least the same as the length of the candidates batch.
See also
IDescriptorBatch::getMaxCount().
Returns
Result with error code.
See also
Span, MatchingResult, IDescriptor, IDescriptorBatch, Result and FSDKError for details.
Note
all spans should be based on user owned continuous collections.

The documentation for this struct was generated from the following file: