|
本帖最后由 linbin250 于 2017-7-9 23:00 编辑
网上找到2015年"于仕琪"的帖子 "免费、高性能的人脸检测库"
http://www.opencv.org.cn/forum.php?mod=viewthread&tid=34155
于仕琪,博士,助理研究员,深圳大学副教授,OpenCV中文站站长。
==========================================
2015年12月7日更新:
三个人脸检测函数再次提速,multiview_reinforce()提速为上一版本的2.3倍,已经比OpenCV的正面人脸检测还要快!要知道其他两个函数比这个更快哦,最快的达到232FPS!
---------------------------------------------------------------------
2015年4月22日更新:
我们的免费人脸检测库再次更新:①正面人脸检测的角度范围从[-40, 40]度提升到[-60,60]度,检测角度变大但计算量不增加;②多视角人脸检测速度提升2倍!
---------------------------------------------------------------------
本团队雕琢多年的人脸检测库现以MIT协议发布 ,供商业和非商业无限制使用,包含正面和多视角人脸检测两个算法.优点:速度快(OpenCV haar+adaboost的2-3倍), 准确度高 (FDDB非公开类评测排名第二),能估计人脸角度. 例子看下图. 希望能帮助到有需要的个人和公司。
这个库比OpenCV自带的人脸检测强大一个数量级!纯C语言生成的二进制库,不依赖任何其他的库。接口更简洁,就一个函数。正面人脸检测,多视角人脸检测的API分别如下:
int * facedetect_frontal( unsigned char * gray_image_data, int width, int height, int step,
float scale,
int min_neighbors,
int min_size,
int max_size=0);
int * facedetect_multiview( unsigned char * gray_image_data, int width, int height, int step,
float scale,
int min_neighbors,
int min_size,
int max_size=0);
DLL库的下载地址:https://github.com/ShiqiYu/libfacedetection
转发到论坛的下载:
该人脸识别库在百度上找了很久,没有成功移植到C#的方法,认真学习后,成功移植,并成功移植到C#上。例子是VS2010, NET4.0编译环境
//下面是库的声明
[DllImport("libfacedetect.dll", CharSet = CharSet.Auto, EntryPoint = "?facedetect_frontal@@YAPAHPAE0HHHMHHHH@Z", CallingConvention = CallingConvention.Cdecl)]
unsafe public static extern byte* facedetect_frontal(
[In, Out]byte* result_buffer,
[In, Out]byte* gray_image_data,
int width, int height, int step,
float scale, //scale factor for scan windows
int min_neighbors, //how many neighbors each candidate rectangle should have to retain it
int min_object_width, //Minimum possible face size. Faces smaller than that are ignored.
int max_object_width = 0, //Maximum possible face size. Faces larger than that are ignored. It is the largest posible when max_object_width=0.
int doLandmark = 0); // landmark detection
[DllImport("libfacedetect.dll", CharSet = CharSet.Auto, EntryPoint = "?facedetect_frontal_surveillance@@YAPAHPAE0HHHMHHHH@Z", CallingConvention = CallingConvention.Cdecl)]
unsafe public static extern byte* facedetect_frontal_surveillance(
[In, Out]byte* result_buffer, //buffer memory for storing face detection results, !!its size must be 0x20000 Bytes!!
[In, Out]byte* gray_image_data, int width, int height, int step, //input image, it must be gray (single-channel) image!
float scale, //scale factor for scan windows
int min_neighbors, //how many neighbors each candidate rectangle should have to retain it
int min_object_width, //Minimum possible face size. Faces smaller than that are ignored.
int max_object_width = 0, //Maximum possible face size. Faces larger than that are ignored. It is the largest posible when max_object_width=0.
int doLandmark = 0); // landmark detection
[DllImport("libfacedetect.dll", CharSet = CharSet.Auto, EntryPoint = "?facedetect_multiview@@YAPAHPAE0HHHMHHHH@Z", CallingConvention = CallingConvention.Cdecl)]
unsafe public static extern byte* facedetect_multiview(
[In, Out]byte* result_buffer, //buffer memory for storing face detection results, !!its size must be 0x20000 Bytes!!
[In, Out]byte* gray_image_data, int width, int height, int step, //input image, it must be gray (single-channel) image!
float scale, //scale factor for scan windows
int min_neighbors, //how many neighbors each candidate rectangle should have to retain it
int min_object_width, //Minimum possible face size. Faces smaller than that are ignored.
int max_object_width = 0, //Maximum possible face size. Faces larger than that are ignored. It is the largest posible when max_object_width=0.
int doLandmark = 0); // landmark detection
[DllImport("libfacedetect.dll", CharSet = CharSet.Auto, EntryPoint = "?facedetect_multiview_reinforce@@YAPAHPAE0HHHMHHHH@Z", CallingConvention = CallingConvention.Cdecl)]
unsafe public static extern byte* facedetect_multiview_reinforce(
[In, Out]byte* result_buffer, //buffer memory for storing face detection results, !!its size must be 0x20000 Bytes!!
[In, Out]byte* gray_image_data, int width, int height, int step, //input image, it must be gray (single-channel) image!
float scale, //scale factor for scan windows
int min_neighbors, //how many neighbors each candidate rectangle should have to retain it
int min_object_width, //Minimum possible face size. Faces smaller than that are ignored.
int max_object_width = 0, //Maximum possible face size. Faces larger than that are ignored. It is the largest posible when max_object_width=0.
int doLandmark = 0); // landmark detection
C#例子程序 VS2010编程环境 .NET4.0
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|