资源简介
人脸预处理,lbp特征提取,svm训练与识别。
代码片段和文件信息
#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);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 132608 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\Debug\RecognizeFace_hj.exe
文件 872676 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\Debug\RecognizeFace_hj.ilk
文件 2141184 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\Debug\RecognizeFace_hj.pdb
文件 919871 2013-05-27 15:59 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\cascades\haarcascade_frontalface_alt.xm
文件 1780 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\cl.command.1.tlog
文件 42538 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\CL.read.1.tlog
文件 2270 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\CL.write.1.tlog
文件 213716 2014-05-15 10:42 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\HaarDetect.obj
文件 447370 2014-05-15 17:31 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\LBPHFaceRecognizer.obj
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
文件 2 2014-05-15 17:45 RecognizeFace\RecognizeFace_hj\RecognizeFace_hj\Debug\li
............此处省略50个文件信息
- 上一篇:photoshop作品作业psd格式
- 下一篇:EMD分解程序
评论
共有 条评论