人脸考勤识别项目

本文介绍了如何使用4412开发板结合百度云人脸识别算法,通过外置摄像头进行人脸面部采集、截取和识别,并返回识别结果。过程中涉及到putty和Winscp软件的使用,以及开发板与电脑的网络配置和程序烧写。
摘要由CSDN通过智能技术生成

基于百度云人脸识别算法和4412开发板、外置摄像头实现人脸面部的采集,截取,识别,返回识别结果。

  1. 采用的软件有:putty软件(串行接口连接软件)   Winscp软件(用于电脑和开发板的文件互传) ch341(终端驱动,确保电脑可识别开发板的端口)
  2. 配置环境:确保开发板与电脑网络互连:
  3. 检查互联网网络共享方法:打开电脑命令行(win+r输入cmd)确保电脑对开发板的网络互连:输入ping 192.168.137.2
  4. 检查互联网网络共享方法:打开putty,登录到开发板,在root界面输入上述指令,检查开发板与电脑的连接。
  5. 程序的烧写:
    #include <stdio.h>
    #include <string.h> //memset
    #include <stdlib.h> //malloc free
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <arpa/inet.h> //inet_ntop
    #include <unistd.h>    //sleep
    #include <opencv2/opencv.hpp>
    #include <opencv2/freetype.hpp>
    
    #include "face.h"
    
    using namespace std;
    using namespace cv;
    using namespace aip;
    
    //前后图片的分隔字符串
    #define BOUNDARY "boundary--"
    
    long get_file_size(const char *filename)
    {
        FILE *fp = fopen(filename, "r");
        fseek(fp, 0, SEEK_END);
        long size = ftell(fp);
        fclose(fp);
        return size;
    }
    
    void send_file(FILE *fp, const char *filename)
    {
        long size = get_file_size(filename);
        char *body = (char *)malloc(size);
        FILE *file = fopen(filename, "r");
        fread(body, 1, size, file);
        fclose(file);
        fwrite(body, 1, size, fp);
        free(body);
    }
    
    void send_buffer(FILE *fp, const char *buf, long size)
    {
        fwrite(buf, 1, size, fp);
    }
    
    Mat image; //core
    pthread_mutex_t image_lock = PTHREAD_MUTEX_INITIALIZER;
    
    Mat frame;
    pthre
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值