资源简介
(需要配置好opencv)支持多目标检测,人脸识别
代码片段和文件信息
#include “HaarDetect.h“
#include
#include
using namespace std;
CvHaarClassifierCascade* Load_Haar_Cascade()
{
CvHaarClassifierCascade* faceCascade = NULL;
const char *faceCascadeFilename = “cascades\\haarcascade_frontalface_alt.xml“;
faceCascade = (CvHaarClassifierCascade*)cvLoad(faceCascadeFilename000);
if(faceCascade==NULL)
{
cout<<“error in Load_Haar_Cascade:faceCascade is NULL“< }
return faceCascade;
}
void detectFace(IplImage* frameCvHaarClassifierCascade *faceCascadeCvRect *faceRectint &count)
{
const int flag = CV_HAAR_DO_CANNY_PRUNING;
CvSeq *detectedFaces;
CvMemStorage* storage;
const double scale_factore = 1.1f;
storage = cvCreateMemStorage(0);
cvClearMemStorage(storage);
if(faceCascade==NULL)
{
cout<<“error in detectFace:faceCascade is NULL!“< exit(1);
}
IplImage* grayframe = NULL;
grayframe = cvCreateImage(cvGetSize(frame)IPL_DEPTH_8U1);
cvCvtColor(framegrayframeCV_RGB2GRAY);
detectedFaces = cvHaarDetectobjects(grayframefaceCascadestoragescale_factore3flagcvSize(2020));
count = detectedFaces->total;
if(detectedFaces==NULL)
{
cout<<“error in detectFace:detectedFaces is NULL“< }
for(int i=0;i<(detectedFaces->total);i++)
{
faceRect[i] = *(CvRect *)cvGetSeqElem(detectedFacesi);
}
if(faceRect == NULL)
{
cout<<“error in detectFace:faceRect is NULL!“< }
cvReleaseMemStorage(&storage);
cvReleaseImage(&grayframe);
}
相关资源
- KPCA人脸识别程序
- 图片动漫风格化
- 基于SVM与ANN的车牌识别
- OpenCV实现同一窗口显示多幅图片
- haar特征的手势检测OpenCV
- 最新人脸识别技术实现的人脸识别系
- 基于opencv的人脸表情识别的预处理
- opencv+qt+vs的摄像头视频显示和处理G
- OpenCV算法精解——源码和测试图片
- opencv结构光生成代码
- opencv 书籍
- 基于PCA的人脸识别系统
-
haartraining+ob
jectmarker,opencv,Adaboo - opencv提取光斑质心
- Ubuntu下Opencv显示中文
- 划痕缺陷检测
- 单USB双目摄像头拍摄程序
- RAAR相位恢复 opencv
- FTVd全变差去模糊opencv实现
- 全变差TV去噪(split bregman) opencv
- opencv开启本地摄像头并拍照
- 基于opencv的激光线中心提取源码
- UD12807B-A__DS-K1T607人脸识别终端_用户手
- opencv3.0 鱼眼标定校正 改进
- 简单的一维高斯滤波程序
- FreeType 结合opencv在图像上显示中文程
- 基于Qt的人脸识别
- Mastering OpenCV with Practical Computer Visio
- opencv计算机视觉编程攻略图片集
- 人脸识别二次开发包(SDK)
评论
共有 条评论