Luxand FaceSDK – Tracker Functions
FSDK_CreateTracker Function
Creates a new tracker handle to be passed to other Tracker API functions.
C++ Syntax:
int FSDK_CreateTracker(HTracker * Tracker);
Delphi Syntax:
function FSDK_CreateTracker(Tracker: PHTracker): integer;
C# Syntax:
int FSDK.CreateTracker(ref int Tracker);
VB Syntax:
Function FSDKVB_CreateTracker(ByRef Tracker As Long) As Long
Java and Android Syntax:
int FSDK.CreateTracker(HTracker Tracker);
Parameters:
Tracker – pointer to the integer variable that will to store the created tracker handle.
Return Value:
Returns FSDKE_OK if successful.
Python Syntax:
def FSDK.CreateTracker() -> Tracker;
# constructor
Tracker() -> Tracker
Return Value:
New Tracker object.
FSDK_FreeTracker Function
Frees a tracker handle. The handle becomes invalid, and all memory associated with it is released. You should not pass the tracker handle to any other Tracker API functions after the handle was freed.
C++ Syntax:
int FSDK_FreeTracker(HTracker Tracker);
Delphi Syntax:
function FSDK_FreeTracker(Tracker: HTracker): integer;
C# Syntax:
int FSDK.FreeTracker(int Tracker);
VB Syntax:
Function FSDKVB_FreeTracker (ByVal Tracker As Long) As Long
Java and Android Syntax:
int FSDK.FreeTracker(HTracker Tracker);
Parameters:
Tracker – handle of the tracker to be freed.
Return Value:
Returns FSDKE_OK if successful.
Python Syntax:
def FSDK.FreeTracker(tracker: Tracker);
def Tracker.Free();
Note:
Tracker object is freed automatically by destructor.
FSDK_ClearTracker Function
Clears the content of a tracker, releasing all its memory. The tracker handle stays valid. The tracker handle stays valid. The parameters are reset to their default values, so if you just need to clear the tracker’s memory, consider setting the parameters with the FSDK_SetTrackerParameter or the FSDK_SetTrackerMultipleParameters function again.
C++ Syntax:
int FSDK_ClearTracker(HTracker Tracker);
Delphi Syntax:
function FSDK_ClearTracker(Tracker: HTracker): integer;
C# Syntax:
int FSDK.ClearTracker(int Tracker);
VB Syntax:
Function FSDKVB_ClearTracker(ByVal Tracker As Long) As Long
Java and Android Syntax:
int FSDK.ClearTracker(HTracker Tracker);
Parameters:
Tracker – handle of the tracker to be cleared.
Return Value:
Returns FSDKE_OK if successful.
Python Syntax:
def FSDK.ClearTracker(tracker: Tracker);
def Tracker.Clear();
Return Value:
Note.
FSDK_SetTrackerParameter Function
Sets the parameter of a tracker. See the Tracker Parameters section for details.
C++ Syntax:
int FSDK_SetTrackerParameter(HTracker Tracker, const char * ParameterName, const char * ParameterValue);
Delphi Syntax:
function FSDK_SetTrackerParameter(Tracker: HTracker; ParameterName, ParameterValue: PAnsiChar): integer;
C# Syntax:
int FSDK.SetTrackerParameter(int Tracker, string ParameterName, string ParameterValue);
VB Syntax:
Function FSDKVB_SetTrackerParameter(ByVal Tracker As Long, ByVal ParameterName As String, ByVal ParameterValue As String) As Long
Java and Android Syntax:
int FSDK.SetTrackerParameter(HTracker Tracker, String ParameterName, String ParameterValue);
Parameters:
Tracker – handle of the tracker to have parameters set parameters.
ParameterName – name of the parameter to be set.
ParameterValue – value of the parameter.
Return Value:
Returns FSDKE_OK if successful.
Python Syntax:
def FSDK.SetTrackerParameter(tracker: Tracker, paramName: str, paramValue);
def Tracker.SetParameter(paramName: str, paramValue);
Return Value:
None.
Note:
The type of parameterValue can be of types: str, int, float ot bool.
FSDK_SetTrackerMultipleParameters Function
Sets multiple parameters of a tracker.The parameters and their values are specified in the following format:
"Parameter1=Value1[;Parameter2=Value2[;…]]"
See the Tracker Parameters section for details.
C++ Syntax:
int FSDK_SetTrackerMultipleParameters(HTracker Tracker, const char * Parameters, int * ErrorPosition);
Delphi Syntax:
function FSDK_SetTrackerMultipleParameters(Tracker: HTracker; Parameters: PAnsiChar; ErrorPosition: PInteger): integer;
C# Syntax:
int FSDK.SetTrackerMultipleParameters(int Tracker, string Parameters, ref int ErrorPosition);
VB Syntax:
Function FSDKVB_SetTrackerMultipleParameters(ByVal Tracker As Long, ByVal Parameters As String, ByRef ErrorPosition As Long) As Long
Java and Android Syntax:
int FSDK.SetTrackerMultipleParameters(HTracker Tracker, String Parameters, IntByReference ErrorPosition);
Parameters:
Tracker – handle of the tracker to have parameters set.
Parameters – string containing the parameters and corresponding values to be set.
ErrorPosition – pointer to the integer variable that will receive the position of the character that caused syntax error in the string.
Return Value:
Returns FSDKE_OK if successful. In case of syntax error returns FSDKE_SYNTAX_ERROR and sets the value of the ErrorPosition variable.
Example:
int err = 0;
FSDK_SetTrackerMultipleParameters(tracker, "HandleArbitraryRotations=false; DetermineFaceRotationAngle=false; InternalResizeWidth=100; FaceDetectionThreshold=5;", &err);
Python Syntax:
def FSDK.SetTrackerMultipleParameters(tracker: Tracker, parameters: str);
def Tracker.SetParameters(**kw);
Return Value:
None.
Note:
Keyword argumets are interpreted as parameter names with their values to be set.
FSDK_GetTrackerParameter Function
Retrieves the value of a tracker parameter. See the Tracker Parameters section for details.
C++ Syntax:
int FSDK_GetTrackerParameter(HTracker Tracker, const char * ParameterName, char * ParameterValue, long long MaxSizeInBytes);
Delphi Syntax:
function FSDK_GetTrackerParameter(Tracker: HTracker; ParameterName, ParameterValue: PAnsiChar; MaxSizeInBytes: int64): integer;
C# Syntax:
int FSDK.GetTrackerParameter(int Tracker, string ParameterName, out string ParameterValue, long MaxSizeInBytes)
VB Syntax:
Function FSDKVB_GetTrackerParameter(ByVal Tracker As Long, ByVal ParameterName As String, ByRef ParameterValue As String, ByVal MaxSizeInBytes As Currency) As Long
Java and Android Syntax:
int FSDK.GetTrackerParameter(HTracker Tracker, String ParameterName, String ParameterValue[], long MaxSizeInBytes);
Parameters:
Tracker – handle of the tracker whose parameter value is desired.
ParameterName – name of the parameter to be retrieved.
ParameterValue – pointer to the output null-terminated string that will store the value of the parameter.
MaxSizeInBytes –amount of memory allocated for the output string.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_INSUFFICIENT_BUFFER_SIZE if there is not enough room to store the output string; however, the output string still fills up all the space available.
Python Syntax:
def FSDK.GetTrackerParameter(tracker: Tracker, parameterName: str) -> str;
def Tracker.GetParameters(parameterName: str) -> str;
Return Value:
The value of parameter as string.
FSDK_FeedFrame Function
Processes a video frame according to tracker’s parameters, and returns the identifiers of the tracked faces. See the Understanding Identifiers, Tracker Memory and Tracker Parameters sections for details.
C++ Syntax:
int FSDK_FeedFrame(HTracker Tracker, long long CameraIdx, HImage Image, long long * FaceCount, long long * IDs, long long MaxSizeInBytes);
Delphi Syntax:
function FSDK_FeedFrame(Tracker: HTracker; CameraIdx: int64; Image: HImage; FaceCount: PInt64; IDs: PIDArray; MaxSizeInBytes: int64): integer;
C# Syntax:
int FSDK.FeedFrame(int Tracker, long CameraIdx, int Image, ref long FaceCount, out long[] IDs, long MaxSizeInBytes)
VB Syntax:
Function FSDKVB_FeedFrame(ByVal Tracker As Long, ByVal CameraIdx As Currency, ByVal Image As Long, ByRef FaceCount As Currency, ByRef IDs As Currency, ByVal MaxSizeInBytes As Currency) As Long
Java and Android Syntax:
int FSDK.FeedFrame(HTracker Tracker, long CameraIdx, HImage Image, long FaceCount[], long IDs[], long MaxSizeInBytes);
Parameters:
Tracker – handle of the tracker in which to process the frame.
CameraIdx – index of the camera; should be equal to 0 in the current release.
Image – the HImage handle of the video frame to process.
FaceCount – address of the 64-bit integer value that will receive the count of faces tracked in the current frame.
IDs – address of the array of 64-bit integer values that will receive the identifiers of the tracked faces.
MaxSizeInBytes – amount of memory allocated for the IDs array.
Return Value:
Returns FSDKE_OK if successful.
Python Syntax:
def FSDK.FeedFrame(tracker: Tracker, cameraIdx: int, image: Image, maxIDs: int = 512) -> List[int];
def Tracker.FeedFrame(cameraIdx: int, img: Image, maxIDs: int = 512) -> List[int];
Return Value:
The list of identifiers of the tracked faces.
Parameters:
maxIDs – the maximum number of faces tracked in the current frame.
Note:
The list of identifiers of the tracked faces.
FSDK_GetTrackerEyes Function
Retrieves the coordinates of the eye centers of a tracked face. The function accepts the identifier returned by FSDK_FeedFrame. This identifier should be passed to FSDK_GetTrackerEyes before the next call of FSDK_FeedFrame using the same tracker.
For the function to return the eye center coordinates, at least one of the parameters DetectEyes, DetectFacialFeatures, RecognizeFaces, DetectGender, DetectAge or DetectExpression must be set to true.
C++ Syntax:
int FSDK_GetTrackerEyes(HTracker Tracker, long long CameraIdx, long long ID, FSDK_Features * FacialFeatures);
Delphi Syntax:
function FSDK_GetTrackerEyes(Tracker: HTracker; CameraIdx, ID: int64; FacialFeatures: PFSDK_Features): integer;
C# Syntax:
int FSDK.GetTrackerEyes(int Tracker, long CameraIdx, long ID, out TPoint[] FacialFeatures)
VB Syntax:
Function FSDKVB_GetTrackerEyes(ByVal Tracker As Long, ByVal CameraIdx As Currency, ByVal ID As Currency, ByRef FacialFeatures As TPoint) As Long
Java Syntax:
int FSDK.GetTrackerEyes(HTracker Tracker, long CameraIdx, long ID, FSDK_Features.ByReference FacialFeatures);
Android Syntax:
int FSDK.GetTrackerEyes(HTracker Tracker, long CameraIdx, long ID, FSDK_Features FacialFeatures);
Parameters:
Tracker – handle of the tracker where the coordinates of the eye centers will be retrieved.
CameraIdx – index of the camera; should be equal to 0 in the current release.
ID – identifier of the subject returned by FSDK_FeedFrame, whose eye center coordinates will be received.
FacialFeatures – pointer to the FSDK_Features variable that will receive the eye center coordinates.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_ID_NOT_FOUND if the specified ID was not returned by the previous FSDK_FeedFrame call. Returns FSDKE_ATTRIBUTE_NOT_DETECTED if eye centers were not tracked on the previous FSDK_FeedFrame call.
Python Syntax:
def FSDK.GetTrackerEyes(tracker: Tracker, cameraIdx: int, ID: int) -> Eyes;
def Tracker.GetEyes(cameraIdx: int, ID: int) -> Eyes;
Return Value:
The Eyes object.
FSDK_GetTrackerFacialFeatures Function
Retrieves the coordinates of a tracked face’s features. The function accepts the identifier returned by FSDK_FeedFrame. This identifier should be passed to FSDK_GetTrackerFacialFeatures before the next call of FSDK_FeedFrame with the same tracker.
For the function to return the facial feature coordinates, either of the parameters DetectFacialFeatures, DetectGender, DetectAge or DetectExpression should be set to true. See the Tracker Parameters section for details.
C++ Syntax:
int FSDK_GetTrackerFacialFeatures(HTracker Tracker, long long CameraIdx, long long ID, FSDK_Features * FacialFeatures);
Delphi Syntax:
function FSDK_GetTrackerFacialFeatures(Tracker: HTracker; CameraIdx, ID: int64; FacialFeatures: PFSDK_Features): integer;
C# Syntax:
int FSDK.GetTrackerFacialFeatures(int Tracker, long CameraIdx, long ID, out TPoint[] FacialFeatures)
VB Syntax:
Function FSDKVB_GetTrackerFacialFeatures(ByVal Tracker As Long, ByVal CameraIdx As Currency, ByVal ID As Currency, ByRef FacialFeatures As TPoint) As Long
Java Syntax:
int FSDK.GetTrackerFacialFeatures(HTracker Tracker, long CameraIdx, long ID, FSDK_Features.ByReference FacialFeatures);
Android Syntax:
int FSDK.GetTrackerFacialFeatures(HTracker Tracker, long CameraIdx, long ID, FSDK_Features FacialFeatures);
Parameters:
Tracker – handle of the tracker from which to retrieve the facial feature coordinates.
CameraIdx – index of the camera; should be equal to 0 in the current release.
ID – identifier of the subject returned by FSDK_FeedFrame, whose facial feature coordinates will be received.
FacialFeatures – pointer to the FSDK_Features variable to receive facial feature coordinates.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_ID_NOT_FOUND if the specified ID was not returned by the previous FSDK_FeedFrame call. ReturnsFSDKE_ATTRIBUTE_NOT_DETECTED if facial features were not tracked on the previous FSDK_FeedFrame call.
Python Syntax:
def FSDK.GetTrackerFacialFeatures(tracker: Tracker, cameraIdx: int, ID: int) -> Features;
def Tracker.GetFacialFeatures(cameraIdx: int, ID: int) -> Features;
Return Value:
The Features object.
Exceptions:
FSDK.IdNotFound
FSDK.AttributeNotDetected
FSDK_GetTrackerFacePosition Function
Retrieves the position of a tracked face. The function accepts the identifier returned by FSDK_FeedFrame. This identifier should be passed to FSDK_GetTrackerFacePosition before the next call of FSDK_FeedFrame with the same tracker.
C++ Syntax:
int FSDK_GetTrackerFacePosition(HTracker Tracker, long long CameraIdx, long long ID, TFacePosition * FacePosition);
Delphi Syntax:
function FSDK_GetTrackerFacePosition(Tracker: HTracker; CameraIdx, ID: int64; FacePosition: PFacePosition): integer;
C# Syntax:
int FSDK.GetTrackerFacePosition(int Tracker, long CameraIdx, long ID, ref TFacePosition FacePosition);
VB Syntax:
Function FSDKVB_GetTrackerFacePosition(ByVal Tracker As Long, ByVal CameraIdx As Currency, ByVal ID As Currency, ByRef facePosition As TFacePosition) As Long
Java Syntax:
int FSDK.GetTrackerFacePosition(HTracker Tracker, long CameraIdx, long ID, TFacePosition.ByReference FacePosition);
Android Syntax:
int FSDK.GetTrackerFacePosition(HTracker Tracker, long CameraIdx, long ID, TFacePosition FacePosition);
Parameters:
Tracker – handle of the tracker from which to retrieve the face position.
CameraIdx – index of the camera; should be equal to 0 in the current release.
ID – identifier of the subject returned by FSDK_FeedFrame whose face position will be received.
FacePosition – pointer to the TFacePosition variable that will receive the face position.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_ID_NOT_FOUND if the specified ID was not returned by the previous FSDK_FeedFrame call.
Python Syntax:
def FSDK.GetTrackerFacePosition(tracker: Tracker, cameraIdx: int, ID: int) -> FacePosition;
def Tracker.GetFacePosition(cameraIdx: int, ID: int) -> FacePosition;
Return Value:
The FacePosition object.
Exceptions:
FSDK.IdNotFound
FSDK_GetTrackerFacialAttribute Function
Given an attribute of a tracked face, retrieves its Values and their Confidences. The function accepts the identifier returned by FSDK_FeedFrame. This identifier should be passed to FSDK_GetTrackerFacialAttribute before the next call of FSDK_FeedFrame with the same tracker.
The function allows for detecting gender when provided with the "Gender" attribute name, for detecting age when provided with the "Age" attribute name and for detecting expression when provided with the "Expression" attribute name. Refer to the FSDK_DetectFacialAttributeUsingFeatures function description for details on attributes, their Values and Confidences.
C++ Syntax:
int FSDK_GetTrackerFacialAttribute(HTracker Tracker, long long CameraIdx, long long ID, const char * AttributeName, char * AttributeValues, long long MaxSizeInBytes);
Delphi Syntax:
function FSDK_GetTrackerFacialAttribute(Tracker: HTracker; CameraIdx, ID: int64; AttributeName, AttributeValues: PAnsiChar; MaxSizeInBytes: int64): integer;
C# Syntax:
int FSDK.GetTrackerFacialAttribute(int Tracker, long CameraIdx, long ID, string AttributeName, out string AttributeValues, long MaxSizeInBytes);
VB Syntax:
Function FSDKVB_GetTrackerFacialAttribute(ByVal Tracker As Long, ByVal CameraIdx As Currency, ByVal ID As Currency, ByVal AttributeName As String, ByRef AttributeValues As String, ByVal MaxSizeInBytes As Currency) As Long
Java and Android Syntax:
int FSDK.GetTrackerFacialAttribute(HTracker Tracker, long CameraIdx, long ID, String AttributeName, String AttributeValues[], long MaxSizeInBytes);
Parameters:
Tracker – handle of the tracker whose attribute will be retrieved.
CameraIdx – index of the camera; should be equal to 0 in the current release.
ID – identifier of a subject returned by FSDK_FeedFrame whose attribute will be retrieved.
AttributeName – name of the attribute.
AttributeValues – pointer to the null-terminated string that will receive the attribute Values and their Confidences.
MaxSizeInBytes – amount of memory allocated for the output string.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_ID_NOT_FOUND if the specified ID was not returned by the previous FSDK_FeedFrame call. ReturnsFSDKE_ATTRIBUTE_NOT_DETECTED if the specified attribute was not detected on the previous FSDK_FeedFrame call. Returns FSDKE_UNKNOWN_ATTRIBUTE if the specified attribute name is not supported. Returns FSDKE_INSUFFICIENT_BUFFER_SIZE if there is not enough room to store the output string; however, the output string still fills up all the space available.
Python Syntax:
def FSDK.GetTrackerFacialAttribute(tracker: Tracker, cameraIdx: int, ID: int, attributeName: str) -> str;
def Tracker.GetFacialAttribute(cameraIdx: int, ID: int, attributeName: str) -> str;
Return Value:
The attribute Values and their Confidences as string.
Exceptions:
FSDK.IdNotFound
FSDK.AttributeNotDetected
FSDK.UnknownAttribute
FSDK_LockID Function
Locks an identifier. When an identifier is locked, at least one facial appearance of an identifier will not be deleted during any possible purge. You should call this function before the FSDK_SetName function. The function has no effect on identifiers which were already tagged with a name. The call should be usually paired with FSDK_UnlockID call. When the user does not set a name to a locked identifier, unlocking it allows it to become purged if necessary for memory efficient memory use.
See the Locking identifiers section for details. You may call this function with any identifier regardless of when it was returned as long as it remains present in the tracker memory.
C++ Syntax:
int FSDK_LockID(HTracker Tracker, long long ID);
Delphi Syntax:
function FSDK_LockID(Tracker: HTracker; ID: int64): integer;
C# Syntax:
int FSDK.LockID(int Tracker, long ID);
VB Syntax:
Function FSDKVB_LockID(ByVal Tracker As Long, ByVal ID As Currency) As Long
Java and Android Syntax:
int FSDK.LockID(HTracker Tracker, long ID);
Parameters:
Tracker – handle of the tracker in which to lock an identifier.
ID – identifier of the subject to lock.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_ID_NOT_FOUND if the specified ID is not present in the tracker memory.
Python Syntax:
def FSDK.LockID(tracker: Tracker, ID: int);
def Tracker.LockID(ID: int);
Return Value:
None.
Exceptions:
FSDK.IdNotFound.
FSDK_UnlockID Function
Unlocks the ID so it may be purged. You should call this function after the FSDK_LockID call. The function has no effect on identifiers which were already tagged with a name.
See the Locking identifiers section for details. You may call this function with any identifier regardless of when it was returned, as long as it is present in the tracker memory.
C++ Syntax:
int FSDK_UnlockID(HTracker Tracker, long long ID);
Delphi Syntax:
function FSDK_UnlockID(Tracker: HTracker; ID: int64): integer;
C# Syntax:
int FSDK.UnlockID(int Tracker, long ID);
VB Syntax:
Function FSDKVB_UnlockID(ByVal Tracker As Long, ByVal ID As Currency) As Long
Java and Android Syntax:
int FSDK.UnlockID(HTracker Tracker, long ID);
Parameters:
Tracker – handle of the tracker in which to unlock an identifier.
ID – identifier of the subject to unlock.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_ID_NOT_FOUND if the specified ID is not present in the tracker memory.
Python Syntax:
def FSDK.UnLockID(tracker: Tracker, ID: int);
def Tracker.UnLockID(ID: int);
Return Value:
None.
Exceptions:
FSDK.IdNotFound
FSDK_PurgeID Function
Removes all facial appearances of the ID from the tracker memory. You must call this function if there was a false acceptance (see the Dealing with false acceptances section) or if you erroneously assigned equal names to different persons.
C++ Syntax:
int FSDK_PurgeID(HTracker Tracker, long long ID);
Delphi Syntax:
function FSDK_PurgeID(Tracker: HTracker; ID: int64): integer;
C# Syntax:
int FSDK.PurgeID(int Tracker, long ID);
VB Syntax:
Function FSDKVB_PurgeID(ByVal Tracker As Long, ByVal ID As Currency) As Long
Java and Android Syntax:
int FSDK.PurgeID(HTracker Tracker, long ID);
Parameters:
Tracker – handle of the tracker in which to purge an identifier.
ID – identifier of the subject to purge.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_ID_NOT_FOUND if the specified ID is not present in the tracker memory.
Python Syntax:
def FSDK.PurgeID(tracker: Tracker, ID: int);
def Tracker.PurgeID(ID: int);
Return Value:
None.
Exceptions:
FSDK.IdNotFound.
FSDK_GetName Function
Returns the name the identifier has been tagged with. You may call this function with any identifier regardless of when it was returned, as long as it is present in the tracker memory.
C++ Syntax:
int FSDK_GetName(HTracker Tracker, long long ID, char * Name, long long MaxSizeInBytes);
Delphi Syntax:
function FSDK_GetName(Tracker: HTracker; ID: int64; Name: PAnsiChar; MaxSizeInBytes: int64): integer;
C# Syntax:
int FSDK.GetName(int Tracker, long ID, out string Name, long MaxSizeInBytes);
VB Syntax:
Function FSDKVB_GetName(ByVal Tracker As Long, ByVal ID As Currency, ByRef Name As String, ByVal MaxSizeInBytes As Currency) As Long
Java and Android Syntax:
int FSDK.GetName(int Tracker, long ID, String Name[], long MaxSizeInBytes);
Parameters:
Tracker – handle of the tracker in which to retrieve the name.
ID – identifier of a subject to retrieve the name of.
Name – identifier of the subject whose name is to be retrieved.
MaxSizeInBytes – amount of memory allocated for the output string.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_INSUFFICIENT_BUFFER_SIZE if there is not enough room to store the output string; however, the output string still fills up all the space available. Returns FSDKE_ID_NOT_FOUND if the specified ID is not present in the tracker memory.
Python Syntax:
def FSDK.GetName(tracker: Tracker, ID: int) -> str;
def Tracker.GetName(ID: int) -> str;
Return Value:
Identifier of the subject whose name is to be retrieved.
Exceptions:
FSDK.IdNotFound
FSDK_SetName Function
Sets the name of an identifier. To erase the name tag, specify an empty name string. When erasing the name tag because of a false acceptance, or because you erroneously assigned equal names to different persons, you must also call the FSDK_PurgeID function (see the Dealing with false acceptances section). The function will unlock the identifier if the name is successfully set.
You may call this function with any identifier regardless of when it was returned, as long as it is present in the tracker memory.
C++ Syntax:
int FSDK_SetName(HTracker Tracker, long long ID, const char * Name);
Delphi Syntax:
function FSDK_SetName(Tracker: HTracker; ID: int64; Name: PAnsiChar): integer;
C# Syntax:
int FSDK.SetName(int Tracker, long ID, string Name);
VB Syntax:
Function FSDKVB_SetName(ByVal Tracker As Long, ByVal ID As Currency, ByVal Name As String) As Long
Java Syntax:
int FSDK.SetName(HTracker Tracker, long ID, String Name);
Parameters:
Tracker – handle of the tracker in which to set the name.
ID – identifier of the subject whose name is to be set.
Name – pointer to the null-terminated string containing the name of an identifier.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_ID_NOT_FOUND if the specified ID is not present in the tracker memory.
Returns FSDKE_INSUFFICIENT_TRACKER_MEMORY_LIMIT if there is not enough room to store the identifier’s facial appearances in memory. See the Tracker Memory section for details.
Python Syntax:
def FSDK.SetName(tracker: Tracker, ID: int, name: str);
def Tracker.SetName(ID: int, name: str);
Return Value:
None.
Exceptions:
FSDK.IdNotFound.
FSDK_GetIDReassignment Function
When provided with a subject’s ID received on earlier frames, returns the new subject’s ID if there was a merger. See the Understanding Identifiers section for details. If an identifier was not merged, the function returns the same ID value in the output variable. Note that the function does not return an error if an identifier is not present in the tracker memory; instead; the same ID value is returned in the output variable.
C++ Syntax:
int FSDK_GetIDReassignment(HTracker Tracker, long long ID, long long * ReassignedID);
Delphi Syntax:
function FSDK_GetIDReassignment(Tracker: HTracker; ID: int64; ReassignedID: PInt64): integer;
C# Syntax:
int FSDK.GetIDReassignment(int Tracker, long ID, ref long ReassignedID);
VB Syntax:
Function FSDKVB_GetIDReassignment(ByVal Tracker As Long, ByVal ID As Currency, ByRef ReassignedID As Currency) As Long
Java and Android Syntax:
int FSDK.GetIDReassignment(HTracker Tracker, long ID, long ReassignedID[]);
Parameters:
Tracker – handle of the tracker in which to get the reassigned ID value.
ID – identifier of the subject whose reassigned identifier is sought.
ReassignedID – pointer to the 64-bit integer value that will store the reassigned value of an identifier.
Return Value:
Returns FSDKE_OK if successful.
Python Syntax:
def FSDK.GetIDReassignment(tracker: Tracker, ID: int) -> int;
def Tracker.GetIDReassignment(ID: int) -> int;
Return Value:
Identifier of the subject whose reassigned identifier is sought.
Exceptions:
FSDK.IdNotFound
FSDK_GetSimilarIDCount Function
Returns the number of identifiers that are similar to a given identifier. The function accepts the identifier returned by FSDK_FeedFrame. This identifier should be passed to FSDK_GetSimilarIDCount before the next call of FSDK_FeedFrame with the same tracker. See the Understanding Identifiers section for details.
C++ Syntax:
int FSDK_GetSimilarIDCount(HTracker Tracker, long long ID, long long * Count);
Delphi Syntax:
function FSDK_GetSimilarIDCount(Tracker: HTracker; ID: int64; Count: PInt64): integer;
C# Syntax:
int FSDK.GetSimilarIDCount(int Tracker, long ID, ref long Count);
VB Syntax:
FSDKVB_GetSimilarIDCount(ByVal Tracker As Long, ByVal ID As Currency, ByRef Count As Currency) As Long
Java and Android Syntax:
int FSDK.GetSimilarIDCount(HTracker Tracker, long ID, long Count[]);
Parameters:
Tracker – handle of the tracker in which to retrieve the number of similar identifiers.
ID – identifier of the subject for which to return the number of similar identifiers.
Count – pointer to the 64-bit integer value that will store the number of similar identifiers.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_ID_NOT_FOUND if the specified ID was not returned by the previous FSDK_FeedFrame call.
Python Syntax:
def FSDK.GetSimilarIDCount(tracker: Tracker, ID: int) -> int;
def Tracker.GetSimilarIDCount(ID: int) -> int;
Return Value:
The number of similar identifiers.
Exceptions:
FSDK.IdNotFound
FSDK_GetSimilarIDList Function
Returns the list of identifiers that are similar to a given identifier. The function accepts the identifier returned by FSDK_FeedFrame. This identifier should be passed to FSDK_GetSimilarIDList before the next call of FSDK_FeedFrame with the same tracker. See the Understanding Identifiers section for details.
C++ Syntax:
int FSDK_GetSimilarIDList(HTracker Tracker, long long ID, long long * SimilarIDList, long long MaxSizeInBytes);
Delphi Syntax:
function FSDK_GetSimilarIDList(Tracker: HTracker; ID: int64; SimilarIDList: PIDArray; MaxSizeInBytes: int64): integer;
C# Syntax:
int FSDK.GetSimilarIDList(int Tracker, long ID, out long[] SimilarIDList, long MaxSizeInBytes)
VB Syntax:
Function FSDKVB_GetSimilarIDList(ByVal Tracker As Long, ByVal ID As Currency, ByRef SimilarIDList As Currency, ByVal MaxSizeInBytes As Currency) As Long
Java and Android Syntax:
int FSDK.GetSimilarIDList(HTracker Tracker, long ID, long SimilarIDList[], long MaxSizeInBytes);
Parameters:
Tracker – handle of the tracker in which to get the list of similar identifiers.
ID – identifier of the subject for which to return the list of similar identifiers.
SimilarIDList – pointer to the array of 64-bit integer values that will store the list of similar identifiers.
MaxSizeInBytes – amount of memory allocated for the output array.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_ID_NOT_FOUND if the specified ID was not returned by the previous FSDK_FeedFrame call. Returns FSDKE_INSUFFICIENT_BUFFER_SIZE if there is not enough room to store the output string; however, the output string still fills up all the space available.
Python Syntax:
def FSDK.GetSimilarIDList(tracker: Tracker, ID: int) -> List[int];
def Tracker.GetSimilarIDList(ID: int) -> List[int];
Return Value:
The list of similar identifiers.
Exceptions:
FSDK.IdNotFound
FSDK_GetAllNames Function
Returns the list of names that an identifier can have. The function accepts the identifier returned by FSDK_FeedFrame. This identifier should be passed to FSDK_GetAllNames before the next call of FSDK_FeedFrame with the same tracker. See the Understanding Identifiers and Dealing with false acceptances sections for details.
The function returns all names that belong to a given identifier, and similar identifiers, separated by a semicolon. The output format is:
"Name1[;Name2[;…]]"
You should call this function instead of FSDK_GetName whenever possible, and then parse the returned string for all returned names. Alternatively, you may implement the functionality of FSDK_GetAllNames, calling FSDK_GetName on the given identifier, then FSDK_GetSimilarIDCount and FSDK_GetSimilarIDList to get the list of similar identifiers, then finally call FSDK_GetName on that list.
C++ Syntax:
int FSDK_GetAllNames(HTracker Tracker, long long ID, char * Names, long long MaxSizeInBytes);
Delphi Syntax:
function FSDK_GetAllNames(Tracker: HTracker; ID: int64; Names: PAnsiChar; MaxSizeInBytes: int64): integer;
C# Syntax:
int FSDK.GetAllNames(int Tracker, long ID, out string Names, long MaxSizeInBytes);
VB Syntax:
Function FSDKVB_GetAllNames(ByVal Tracker As Long, ByVal ID As Currency, ByRef Names As String, ByVal MaxSizeInBytes As Currency) As Long
Java and Android Syntax:
int FSDK.GetAllNames(HTracker Tracker, long ID, String Names[], long MaxSizeInBytes);
Parameters:
Tracker – handle of the tracker in which to retrieve the names.
ID – identifier of the subject whose possible names are to be retrieved.
Names – pointer to the null-terminated string that will receive the possible names of an identifier.
MaxSizeInBytes – amount of memory allocated for the output string.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_ID_NOT_FOUND if the specified ID was not returned by the previous FSDK_FeedFrame call. Returns FSDKE_INSUFFICIENT_BUFFER_SIZE if there is not enough room to store the output string; however, the output string still fills up all the space available.
Python Syntax:
def FSDK.GetAllNames(tracker: Tracker, ID: int) -> List[str];
def Tracker.GetAllNames(ID: int) -> List[str];
Return Value:
The list of possible names of an identifier.
Exceptions:
FSDK.IdNotFound.
FSDK_SaveTrackerMemoryToFile Function
Saves the memory of a tracker to a file. Note that tracker parameters, along with its face tracking state, are not saved. See the Saving and Loading Tracker Memory section for details.
C++ Syntax:
int FSDK_SaveTrackerMemoryToFile(HTracker Tracker, const char * FileName);
Delphi Syntax:
function FSDK_SaveTrackerMemoryToFile(Tracker: HTracker; FileName: PAnsiChar): integer;
C# Syntax:
int FSDK.SaveTrackerMemoryToFile(int Tracker, string FileName);
VB Syntax:
Function FSDKVB_SaveTrackerMemoryToFile(ByVal Tracker As Long, ByVal FileName As String) As Long
Java and AndroidSyntax:
int FSDK.SaveTrackerMemoryToFile(HTracker Tracker, String FileName);
Parameters:
Tracker – handle of the tracker to save.
FileName – pointer to the null-terminated string containing the name of the file to which the tracker memory will be saved.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_IO_ERROR if an I/O error has occurred.
Python Syntax:
def FSDK.SaveTrackerMemoryToFile(tracker: Tracker, fileName: str);
def Tracker.SaveToFile(fileName: str);
Return Value:
None.
Exceptions:
FSDK.IOError
FSDK_LoadTrackerMemoryFromFile Function
Loads the memory of a tracker from a file. Note that tracker parameters, along with its face tracking state, are not loaded. See the Saving and Loading Tracker Memory section for details.
C++ Syntax:
int FSDK_LoadTrackerMemoryFromFile(HTracker * Tracker, const char * FileName);
Delphi Syntax:
function FSDK_LoadTrackerMemoryFromFile(Tracker: PHTracker; FileName: PAnsiChar): integer;
C# Syntax:
int FSDK.LoadTrackerMemoryFromFile(ref int Tracker, string FileName);
VB Syntax:
Function FSDKVB_LoadTrackerMemoryFromFile(ByRef Tracker As Long, ByVal FileName As String) As Long
Java and Android Syntax:
int FSDK.LoadTrackerMemoryFromFile(HTracker Tracker, String FileName);
Parameters:
Tracker – pointer that will store the handle of the loaded tracker.
FileName – pointer to the null-terminated string containing the name of a file from which the tracker memory will be to loaded.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_BAD_FILE_FORMAT if the file has unsupported format. Returns FSDKE_UNSUPPORTED_FILE_VERSION if the file was saved with Luxand FaceSDK of an unsupported version. Returns FSDKE_FILE_NOT_FOUND if there was an error opening the file. Returns FSDKE_IO_ERROR if an I/O error has occurred.
Python Syntax:
def FSDK.LoadTrackerMemoryFromFile(fileName: str) -> Tracker;
@staticmethod
def Tracker.FromFile(fileName: str) -> Tracker;
Return Value:
New Tracker object loaded from file.
Exceptions:
FSDK.IOError
FSDK.BadFileFormat
FSDK.UnsupportedFileVersion
FSDK.FileNotFound
FSDK_GetTrackerMemoryBufferSize Function
Returns the size of a buffer (in bytes) needed to save the memory of a tracker.
C++ Syntax:
int FSDK_GetTrackerMemoryBufferSize(HTracker Tracker, long long * BufSize);
Delphi Syntax:
function FSDK_GetTrackerMemoryBufferSize(Tracker: HTracker; BufSize: PInt64): integer;
C# Syntax:
int FSDK.GetTrackerMemoryBufferSize(int Tracker, ref long BufSize);
VB Syntax:
Function FSDKVB_GetTrackerMemoryBufferSize(ByVal Tracker As Long, ByRef BufSize As Currency) As Long
Java and Android Syntax:
int FSDK.GetTrackerMemoryBufferSize(HTracker Tracker, long BufSize[]);
Parameters:
Tracker – handle of the tracker whose buffer size needs calculation.
BufSize – pointer to the 64-bit integer variable that will store the size of a buffer.
Return Value:
Returns FSDKE_OK if successful.
Python Syntax:
def FSDK.GetTrackerMemoryBufferSize(tracker: Tracker) -> int;
Return Value:
The size of a buffer.
FSDK_SaveTrackerMemoryToBuffer Function
Saves the memory of a tracker to a buffer. Note that tracker parameters, along with its face tracking state, are not saved. See the Saving and Loading Tracker Memory section for details.
C++ Syntax:
int FSDK_SaveTrackerMemoryToBuffer(HTracker Tracker, unsigned char * Buffer, long long MaxSizeInBytes);
Delphi Syntax:
function FSDK_SaveTrackerMemoryToBuffer(Tracker: HTracker; var Buffer; MaxSizeInBytes: int64): integer;
C# Syntax:
int FSDK.SaveTrackerMemoryToBuffer(int Tracker, out byte[] Buffer, long MaxSizeInBytes);
VB Syntax:
Function FSDKVB_SaveTrackerMemoryToBuffer(ByVal Tracker As Long, ByRef Buffer As Byte, ByVal MaxSizeInBytes As Currency) As Long
Java and Android Syntax:
int FSDK.SaveTrackerMemoryToBuffer(HTracker Tracker, byte Buffer[]);
Parameters:
Tracker – handle of the tracker to save.
Buffer – pointer to the buffer to which the tracker memory will be saved.
MaxSizeInBytes – amount of memory allocated for the output buffer, in bytes.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_INSUFFICIENT_BUFFER_SIZE if there is not enough room to store the output buffer.
Python Syntax:
def Tracker.GetMemory() -> bytes;
def Tracker.ToBytes() -> bytes;
Return Value:
The bytes objects containing tracker memory.
FSDK_LoadTrackerMemoryFromBuffer Function
Loads the memory of a tracker from a buffer. Note that tracker parameters, along with its face tracking state, are not loaded. See the Saving and Loading Tracker Memory section for details.
C++ Syntax:
int FSDK_LoadTrackerMemoryFromBuffer(HTracker * Tracker, const unsigned char * Buffer);
Delphi Syntax:
function FSDK_LoadTrackerMemoryFromBuffer(Tracker: PHTracker; var Buffer): integer;
C# Syntax:
int FSDK.LoadTrackerMemoryFromBuffer(ref int Tracker, byte[] Buffer);
VB Syntax:
Function FSDKVB_LoadTrackerMemoryFromBuffer(ByRef Tracker As Long, ByRef Buffer As Byte) As Long
Java and Android Syntax:
int FSDK.LoadTrackerMemoryFromBuffer(HTracker Tracker, byte Buffer[]);
Parameters:
Tracker – pointer to store the handle of a loaded tracker.
Buffer – pointer to the buffer from which to load the tracker memory.
Return Value:
Returns FSDKE_OK if successful. Returns FSDKE_BAD_FILE_FORMAT if the file has unsupported format. Returns FSDKE_UNSUPPORTED_FILE_VERSION if the file was saved with Luxand FaceSDK of an unsupported version.
Python Syntax:
def FSDK.LoadTrackerMemoryFromBuffer(buffer: bytes) -> Tracker;
@staticmethod
def Tracker.FromMemory(buffer: bytes) -> Tracker;
@staticmethod
def Tracker.FromBytes(buffer: bytes) -> Tracker;
Return Value:
New Tracker objects loaded from a buffer.