esp-who/examples/esp32-s3-eye/main/include/app_face.hpp

65 lines
1.2 KiB
C++
Raw Normal View History

2022-03-02 19:38:29 +08:00
#pragma once
2022-03-03 14:35:04 +08:00
#include "sdkconfig.h"
2022-03-02 19:38:29 +08:00
#include "human_face_detect_msr01.hpp"
#include "human_face_detect_mnp01.hpp"
#include "face_recognition_tool.hpp"
2022-03-03 14:35:04 +08:00
#if CONFIG_MFN_V1
#if CONFIG_S8
#include "face_recognition_112_v1_s8.hpp"
#elif CONFIG_S16
2022-03-02 19:38:29 +08:00
#include "face_recognition_112_v1_s16.hpp"
2022-03-03 14:35:04 +08:00
#endif
#endif
2022-03-02 19:38:29 +08:00
#include "__base__.hpp"
#include "app_camera.hpp"
2022-03-03 14:35:04 +08:00
#include "app_button.hpp"
2022-03-02 19:38:29 +08:00
#include "app_speech.hpp"
typedef enum
{
2022-03-03 17:13:44 +08:00
FACE_IDLE = 0,
FACE_ENROLL = 1,
FACE_RECOGNIZE = 2,
FACE_DELETE = 3,
} face_action_t;
2022-03-02 19:38:29 +08:00
class AppFace : public Observer, public Frame
{
private:
2022-03-03 14:35:04 +08:00
AppButton *key;
2022-03-02 19:38:29 +08:00
AppSpeech *speech;
public:
HumanFaceDetectMSR01 detector;
HumanFaceDetectMNP01 detector2;
2022-03-03 14:35:04 +08:00
#if CONFIG_MFN_V1
#if CONFIG_S8
FaceRecognition112V1S8 *recognizer;
#elif CONFIG_S16
2022-03-02 19:38:29 +08:00
FaceRecognition112V1S16 *recognizer;
2022-03-03 14:35:04 +08:00
#endif
#endif
2022-03-02 19:38:29 +08:00
face_info_t recognize_result;
2022-03-03 17:13:44 +08:00
face_action_t state;
face_action_t state_previous;
2022-03-02 19:38:29 +08:00
bool switch_on;
uint8_t frame_count;
2022-03-03 14:35:04 +08:00
AppFace(AppButton *key,
AppSpeech *speech,
QueueHandle_t queue_i = nullptr,
QueueHandle_t queue_o = nullptr,
void (*callback)(camera_fb_t *) = esp_camera_fb_return);
2022-03-02 19:38:29 +08:00
~AppFace();
void update();
void run();
};