资源简介
Opencv中文网Yu老师的人脸识别VS2015工程,opencv环境自己配置,Release下有可执行文件。
代码片段和文件信息
/*
The MIT License (MIT)
Copyright (c) 2015-2017 Shiqi Yu
shiqi.yu@gmail.com
Permission is hereby granted free of charge to any person obtaining a copy
of this software and associated documentation files (the “Software“) to deal
in the Software without restriction including without limitation the rights
to use copy modify merge publish distribute sublicense and/or sell
copies of the Software and to permit persons to whom the Software is
furnished to do so subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/* API接口函数说明
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);
/*API
1.it can detect side view faces but slower than facedetect_frontal().
facedetect_multiview
2.it‘s fast but cannot detect side view faces
facedetect_frontal
3.it can detect side view faces better but slower than facedetect_multiview().
facedetect_multiview_reinforce
4.it can detect faces with bad illumination.
facedetect_frontal_surveillance
*/
#include
#include
#include “facedetect-dll.h“
//#pragma comment(lib“libfacedetect.lib“)
#pragma comment(lib“libfacedetect-x64.lib“)
//define the buffer size. Do not change the size!
#define DETECT_BUFFER_SIZE 0x20000
using namespace cv;
int main(int argc char* argv[])
{
//if (argc != 2)
//{
// printf(“Usage: %s \n“ argv[0]);
// return -1;
//}
while (1)
{
Mat gray image dstImage;
//load an image and convert it to gray (single-channel)
/* image = imread(argv[1]);*/
//image = imread(“00.jpeg“);// keliamoniz1.jpg face.jpeg
//if (image.empty())
//{
// fprintf(stderr “Can not load the image file %s.\n“ argv[1]);
// return -1;
//}
VideoCapture capture(0); //从摄像头读入视频
capture >> image;
//namedWindow(“原图“ CV_WINDOW_AUTOSIZE);
//imshow(“原图“ image);
cvtColor(image gray CV_BGR2GRAY);//转化为灰度图
equalizeHist(gray gray);//直方图均衡化,增加对比度方便处理
int * pResults = NULL;
//pBuffer is used in the detection functions.
//If you call functions in multiple threads please create one buffer for each thread!
unsigned char * pBuffer = (unsigned char *)malloc(DETECT_BUFFER_SIZE); //动态内存分配
if (!pBuffer)
{
fprintf(stderr “Can no
- 上一篇:《微型计算机原理与接口技术第3版》冯博琴 教学课件
- 下一篇:射频天线设计基础
相关资源
- opencv相机检校
- 车型识别系统vc源码opencv
- opencv依靠颜色识别和跟踪物体
- OpenCV的PCA人脸识别
- openCV+qt视频传输
- OpenCV 现实高斯金字塔的源码,非常经
- opencv运动目标检测与跟踪源代码
- labview与Opencv 人眼识别
- opencv 将两幅等宽图像拼接在一起
- 图像分类代码
- OpenCV 1.0.0 patch for ffmpeg errors
- 车辆分类检测正负样本共计1000张
- 使用Visual Studio+OpenCV进行的Susan算子边
- 跟踪特征点并画AR物体
- 别踩白块 毕业论文
- 支持OpenCV3.2的opencv_ffmpeg.7z
- openCVSharp Unity3d
- 彩色图像的SVM分割,Opencv实现
- OpenCV2.31库
- Delphi的OpenCV头文件和
- OpenCV 3 Blueprints.pdf[382页可复制]
- 基于opencv接口的深度学习人脸检测代
- 基于opencv的b样条实现
- 北京大学的OPENCV课程PPT_田永鸿
- YML保存 cvCompareHist cvCalcEMD2 直方图对比
- vgg_generated_48(6480120).i
- 基于OpenCV的图像二值化阈值可调
- 基于UDP协议的视频传输
-
convert_cascade 转换xm
l文件 含dll文件 - 基于OPENCV的多种特征提取总结
评论
共有 条评论