libfacedetection
libfacedetection测试
#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <facedetect-dll.h> //define the buffer size. Do not change the size!
//定义缓冲区大小 不要改变大小!
#define DETECT_BUFFER_SIZE 0x20000
using namespace cv; unsigned char * pBuffer; void facedetect_frontal_surveillance1(Mat image); int main()
{
VideoCapture video1();
Mat image;
while ()
{
pBuffer = (unsigned char *)malloc(DETECT_BUFFER_SIZE);
if (!pBuffer)
{
fprintf(stderr, "Can not alloc buffer.\n");
return -;
} //load an image and convert it to gray (single-channel)
//加载图像并将其转换为灰色(单通道)
//Mat image = imread("E:\\libfacedetection\\libfacedetection_install\\images\\keliamoniz1.jpg");
video1.read(image);
//Mat image = imread("E:\\libfacedetection\\libfacedetection_install\\images\\1.jpg");
if (image.empty())
{
return -;
}
facedetect_frontal_surveillance1(image); //waitKey();
char c1 = waitKey();
if (c1 == )
{
break;
} free(pBuffer);
} //release the buffer return ;
} void facedetect_frontal_surveillance1(Mat image)
{
int w1 = image.cols;
int h1 = image.rows; Mat gray;
cvtColor(image, gray, CV_BGR2GRAY); int min_obj_width = ;
float scale1 = 1.1f;
int min_neightbors1 = ; int * pResults = NULL;
//pBuffer is used in the detection functions.
//pBuffer指针用于检测函数。
//If you call functions in multiple threads, please create one buffer for each thread!
//如果您在多个线程中调用函数,请为每个线程创建一个缓冲区! int doLandmark = ; ///////////////////////////////////////////
// frontal face detection designed for video surveillance / 68 landmark detection
//正面人脸检测专为视频监控/ 68标志性检测而设计
// it can detect faces with bad illumination.
//它可以检测到不良照明的面部。
//////////////////////////////////////////
//!!! The input image must be a gray one (single-channel)
//!!! DO NOT RELEASE pResults !!!
pResults = facedetect_frontal_surveillance(pBuffer, (unsigned char*)(gray.ptr()), gray.cols, gray.rows, (int)gray.step,
scale1, min_neightbors1, min_obj_width, , doLandmark);
//printf("%d faces detected.\n", (pResults ? *pResults : 0));
Mat result_frontal_surveillance = image.clone();;
//print the detection results
for (int i = ; i < (pResults ? *pResults : ); i++)
{
short * p = ((short*)(pResults + )) + * i;
int x = p[];
int y = p[];
int w = p[];
int h = p[];
int neighbors = p[];
int angle = p[]; printf("face_rect=[%d, %d, %d, %d], neighbors=%d, angle=%d\n", x, y, w, h, neighbors, angle);
rectangle(result_frontal_surveillance, Rect(x, y, w, h), Scalar(, , ), );
if (doLandmark)
{
for (int j = ; j < ; j++)
circle(result_frontal_surveillance, Point((int)p[ + * j], (int)p[ + * j + ]), , Scalar(, , ));
}
} if (w1>)
{
resize(result_frontal_surveillance, result_frontal_surveillance, Size(w1 / , h1 / ));
} imshow("Results_frontal_surveillance", result_frontal_surveillance); }

libfacedetection的更多相关文章
- libfacedetection简单使用记录
目录 1.源码下载 2.编译 2.1.linux 2.2.Windows MINGW64 2.3.VS2017 NMake编译 3.简单测试程序 3.1.测试截图 3.2.测试代码如下 1.源码下载 ...
- 人脸检测库libfacedetection介绍
libfacedetection是于仕琪老师放到GitHub上的二进制库,没有源码,它的License是MIT,可以商用.目前只提供了windows 32和64位的release动态库,主页为http ...
- 如何快糙好猛的使用libfacedetection库【最新版】
前言 最近已经很少看CSDN了.这一年多准备考研,基本上怕是不会再怎么上了.以前有一个http://blog.csdn.net/mr_curry/article/details/51804072 如何 ...
- libfacedetection 人臉識別
计算相似度,然后比对 QVector<cv::Point> vec_point1 = facedetect_frontal_surveillance4(face_img.clone()); ...
- libfacedetection环境配置
E:\Opencv\libfacedetection_install1\include E:\Opencv\libfacedetection_install1\lib libfacedetect-x6 ...
- 【机器学习Machine Learning】资料大全
昨天总结了深度学习的资料,今天把机器学习的资料也总结一下(友情提示:有些网站需要"科学上网"^_^) 推荐几本好书: 1.Pattern Recognition and Machi ...
- ios项目里扒出来的json文件
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000 } p.p2 { margin: 0.0px 0. ...
- Github上关于iOS的各种开源项目集合(强烈建议大家收藏,查看,总有一款你需要)
下拉刷新 EGOTableViewPullRefresh - 最早的下拉刷新控件. SVPullToRefresh - 下拉刷新控件. MJRefresh - 仅需一行代码就可以为UITableVie ...
- iOS及Mac开源项目和学习资料【超级全面】
UI 下拉刷新 EGOTableViewPullRefresh – 最早的下拉刷新控件. SVPullToRefresh – 下拉刷新控件. MJRefresh – 仅需一行代码就可以为UITable ...
随机推荐
- Ajax -异步请求 -jquery中ajax分类 -第一层 $.ajax -第二层($.get /$.post) -第三层($.getJson/$.getScript) -相应演示
Ajax 1.标准请求响应时浏览器的动作(同步操作) 1.1浏览器请求什么资源,跟随显示什么资源2.ajax:异步请求. 2.1局部刷新,通过异步请求,请求到服务器资源数据后,通过脚本修改页面中部分内 ...
- P1772 [ZJOI2006]物流运输[DP+最短路]
题目描述 物流公司要把一批货物从码头A运到码头B.由于货物量比较大,需要n天才能运完.货物运输过程中一般要转停好几个码头.物流公司通常会设计一条固定的运输路线,以便对整个运输过程实施严格的管理和跟踪. ...
- python get/post接口使用
背景: 使用python调用get post接口,入参.出参都需要转换,在使用时经常会忘记其中的一步,本文用来记录,后面再使用时直接参考使用 代码如下 post: headers = {'Conten ...
- 移动端跨平台应用开发(ios、Android、web)- Flutter 技术
关键词:Google 出品:Dart语言:Flutter Engine引擎:响应式设计模式:原生渲染:免费并且开源 一.简介 Flutter 是谷歌2018年发布的跨平台移动UI框架.作为谷歌的开源移 ...
- jmeter 压测工具安装及使用
linux下jmeter安装: 1. 下载JMeter官方网站下载最新版本: http://jmeter.apache.org/download_jmeter.cgi ,目前最新版是Apache JM ...
- 在idea中调试spark程序-配置windows上的 spark local模式
spark程序大致有如下运行模式: standalone模式:spark自带的模式 spark on yarn:利用hadoop yarn来做集群的资源管理 local模式:主要在测试的时候使用, 这 ...
- Centos 下 Apache 原生 Hbase + Phoenix 集群安装(转载)
前置条件 各软件版本:hadoop-2.7.7.hbase-2.1.5 .jdk1.8.0_211.zookeeper-3.4.10.apache-phoenix-5.0.0-HBase-2.0-bi ...
- BZOJ 2064: 分裂 状压动归
最多的操作次数是 $n+m-1$ (相当于把第一个暴力合并,再暴力拆成第二个).如果第一个序列的一个子序列和第二个区间的子序列相等,那么总次数就可以减 $2$.将第二个序列所有数取反,直接求解有多少个 ...
- [分享]Passcape Software - Windows Password Recovery
[分享]Passcape Software - Windows Password Recovery https://bbs.pediy.com/thread-245965.htm [[other] ...
- RookeyFrame 信息 常用信息整理
博客 https://www.cnblogs.com/rookey/ gitee的地址: https://gitee.com/rookey/Rookey.Frame-v2.0 https://gite ...