海思3559上移植OpenCV3.4.1 (二) 人脸检测

本文档详细记录了在海思3559平台上移植OpenCV3.4.1并进行人脸检测的过程。在完成库文件添加和代码编译后,通过haarcascade_frontalface_alt2.xml实现了人脸检测,但遇到了OpenCV的两个错误:一个是用户对象未知类型的错误,另一个是固定类型断言失败。通过调整代码,成功保存了50x50灰度人脸照片。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

按照海思3559上移植OpenCV3.4.1 (一) 的步骤
已经有 了库和头文件了。

库文件添加

将所有的so库打包到根文件系统的lib路径下。

代码

参考
http://bbs.ebaina.com/thread-4858-1-1.html

代码如下:

#include <stdio.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <sys/reboot.h>
#include <sys/time.h>

#include "cv.h"
#include "highgui.h"
#include "highgui.hpp"

using namespace cv;
using namespace std;

#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif /* __cplusplus */

struct timeval tpstart,tpend;

unsigned long timeuses;
void timeRec()
{
    gettimeofday(&tpstart,0);
}

int timeRep()
{
    gettimeofday(&tpend,0);
    timeuses=(tpend.tv_sec-tpstart.tv_sec)*1000000+tpend.tv_
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值