2019-01-09 19:31:46 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#if __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "fr_forward.h"
|
|
|
|
|
|
|
|
#define FR_FLASH_TYPE 32
|
|
|
|
#define FR_FLASH_SUBTYPE 32
|
|
|
|
#define FR_FLASH_PARTITION_NAME "fr"
|
|
|
|
#define FR_FLASH_INFO_FLAG 12138
|
2020-11-03 20:20:00 +01:00
|
|
|
|
|
|
|
/**
|
2019-01-09 19:31:46 +01:00
|
|
|
* @brief Produce face id according to the input aligned face, and save it to dest_id and flash.
|
|
|
|
*
|
|
|
|
* @param l Face id list
|
|
|
|
* @param aligned_face An aligned face
|
|
|
|
* @return -2 Flash partition not found
|
|
|
|
* @return 0 Enrollment finish
|
|
|
|
* @return >=1 The left piece of aligned faces should be input
|
|
|
|
*/
|
|
|
|
int8_t enroll_face_id_to_flash(face_id_list *l,
|
|
|
|
dl_matrix3du_t *aligned_face);
|
|
|
|
|
2020-11-03 20:20:00 +01:00
|
|
|
/**
|
|
|
|
* @brief Produce face id according to the input aligned face, and save the id-name pairs to dest_id and flash.
|
|
|
|
*
|
|
|
|
* @param l Face id list
|
|
|
|
* @param new_id An aligned face
|
|
|
|
* @param name name corresponding to face id
|
|
|
|
* @return -2 Flash partition not found
|
|
|
|
* @return 0 Enrollment finish
|
|
|
|
* @return >=1 The left piece of aligned faces should be input
|
|
|
|
*/
|
2019-03-03 17:19:11 +01:00
|
|
|
int8_t enroll_face_id_to_flash_with_name(face_id_name_list *l,
|
2019-04-12 15:43:53 +02:00
|
|
|
dl_matrix3d_t *new_id,
|
2019-03-03 17:19:11 +01:00
|
|
|
char *name);
|
2019-01-09 19:31:46 +01:00
|
|
|
/**
|
|
|
|
* @brief Read the enrolled face IDs from the flash.
|
|
|
|
*
|
|
|
|
* @param l Face id list
|
|
|
|
* @return int8_t The number of IDs remaining in flash
|
|
|
|
*/
|
|
|
|
int8_t read_face_id_from_flash(face_id_list *l);
|
2020-11-03 20:20:00 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Read the enrolled face IDs and their corresponding names from the flash.
|
|
|
|
*
|
|
|
|
* @param l Face id list
|
|
|
|
* @return int8_t The number of IDs remaining in flash
|
|
|
|
*/
|
2019-03-03 17:19:11 +01:00
|
|
|
int8_t read_face_id_from_flash_with_name(face_id_name_list *l);
|
|
|
|
|
2019-01-09 19:31:46 +01:00
|
|
|
/**
|
|
|
|
* @brief Delete the enrolled face IDs in the flash.
|
|
|
|
*
|
|
|
|
* @param l Face id list
|
|
|
|
* @return int8_t The number of IDs remaining in flash
|
|
|
|
*/
|
|
|
|
int8_t delete_face_id_in_flash(face_id_list *l);
|
2020-11-03 20:20:00 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Delete the enrolled face ID corresponding to the name in the flash.
|
|
|
|
*
|
|
|
|
* @param l Face id list
|
|
|
|
* @param name The name that needs to be deleted
|
|
|
|
* @return int8_t The number of IDs remaining in flash
|
|
|
|
*/
|
|
|
|
int8_t delete_face_id_in_flash_with_name(face_id_name_list *l, char *name);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Delete all the enrolled face IDs and names paris in the flash.
|
|
|
|
*
|
|
|
|
* @param l Face id list
|
|
|
|
*/
|
2019-03-03 17:19:11 +01:00
|
|
|
void delete_face_all_in_flash_with_name(face_id_name_list *l);
|
2019-01-09 19:31:46 +01:00
|
|
|
|
|
|
|
#if __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|