测试seetaface人脸识别引擎

该测试文件需要放置在FaceIdentification/src/test目录下,为方便编译,代码预处理部分跟文件夹中test_face_verification.cpp相同。编译该文件之前,需要先完成facedetection,facealignment,faceidentification三个模块的编译。

代码如下:

#include<iostream>
using namespace std;

#ifdef _WIN32
#pragma once
#include <opencv2/core/version.hpp>

#define CV_VERSION_ID CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) \
  CVAUX_STR(CV_SUBMINOR_VERSION)

#ifdef _DEBUG
#define cvLIB(name) "opencv_" name CV_VERSION_ID "d"
#else
#define cvLIB(name) "opencv_" name CV_VERSION_ID
#endif //_DEBUG

#pragma comment( lib, cvLIB("core") )
#pragma comment( lib, cvLIB("imgproc") )
#pragma comment( lib, cvLIB("highgui") )

#endif //_WIN32

#if defined(__unix__) || defined(__APPLE__)

#ifndef fopen_s

#define fopen_s(pFile,filename,mode) ((*(pFile))=fopen((filename),(mode)))==NULL

#endif //fopen_s

#endif //__unix

#include <opencv/cv.h>
#include <opencv/highgui.h>
#include "face_identification.h"
#include "recognizer.h"
#include "face_detection.h"
#include "face_alignment.h"
#include <dirent.h>
#include "math_functions.h"
#include <time.h> 
#include <unistd.h>
#include <stdlib.h>

#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <thread>
#include <mutex>

using namespace seeta;

#define TEST(major, minor) major##_##minor##_Tester()
#define EXPECT_NE(a, b) if ((a) == (b)) std::cout << "ERROR: "
#define EXPECT_EQ(a, b) if ((a) != (b)) std::cout << "ERROR: "
//声明变量==============================================================================
    cv::Mat frame;  
    std::vector<std::string> file_name;
    float temp_fea[2048];
    std::mutex mtx;
    bool get_face=false;

    struct st_a{
    std::string name;
    float fea[2048];
    float sim;
    };

    struct st_b{
    std::string name;
    float sim;
    };

    st_a * fea;
//声明函数=============================================================================

    void extract_from_file(std::vector<seeta::FaceInfo> &,int n );
    std::vector<std::string> read_name_from_file(const char* filepath);
    void extract_from_cam(seeta::FaceDetection & ,seeta::FaceAlignment & ,FaceIdentification & ,std::vector<seeta::FaceInfo> & );

    void show_video(cv::VideoCapture & cap);
    void show_picture(std::string filename,std::string win_name,int h_position,int v_position);

//main main main==============================================================================================
int main(){

    const char* filepath = "/home/wd/seeta/image_storehouse";
    const char* image_path = 
  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
智能门锁人脸识别模组的测试用例可以包括以下几个方面: 1. 注册人脸测试注册人脸功能,包括添加新用户的人脸信息,验证是否成功添加到系统。 2. 识别人脸测试识别人脸功能,包括已注册用户的人脸识别,验证是否能够准确地识别已注册用户。 3. 陌生人脸识别测试陌生人脸识别功能,验证是否能够准确地判断陌生人并进行相应的处理,如拒绝进入或触发报警等。 4. 多人脸识别测试人脸同时出现时的识别功能,验证是否能够准确地区分多个人脸进行相应的处理。 5. 光线环境变化:测试在不同光线环境下的人脸识别功能,包括强光、弱光、背光等情况,验证是否能够适应不同的光线环境。 6. 角度变化:测试在不同角度下的人脸识别功能,包括正面、侧面、倾斜等情况,验证是否能够准确地识别人脸。 7. 遮挡情况:测试在部分遮挡的情况下的人脸识别功能,包括戴眼镜、戴口罩等情况,验证是否能够准确地识别人脸。 8. 速度要求:测试在不同速度下的人脸识别功能,包括快速通过、慢速通过等情况,验证是否能够在合理的时间内完成识别。 9. 数据库容量:测试系统对人脸信息的存储容量,包括注册用户数量的上限,验证系统是否能够满足实际需求。 10. 系统稳定性:测试系统的稳定性和可靠性,包括长时间运行、大量并发访问等情况下的表现,验证系统是否能够持续稳定地工作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值