1 // FaceDetection.h: interface for the FaceDetection class.
3 //////////////////////////////////////////////////////////////////////
5 #ifndef _CVFACEDETECTION_H_
6 #define _CVFACEDETECTION_H_
8 #include "cvfacetemplate.h"
10 #include "cvboostingtemplate.h"
12 typedef struct CvContourRect
14 int iNumber; //ïîðÿäêîâûé íîìåð àòðèáóòà
15 int iType; //òèï îáúåêòà
16 int iFlags; //ñâîáîäíîå ïîëå
17 CvSeq *seqContour; //àäðåñ íà÷àëà çàïèñè îáúåêòà
18 int iContourLength; //äëèíà çàïèñè âåêòîðîâ
19 CvRect r; //îïèñàíûé ïðÿìîóãîëüíèê
20 CvPoint pCenter; // center of rect
21 int iColor;// öâåò çàïîëíåíèÿ êîíòóðà
30 ListElem(Face * pFace,ListElem * pHead);
41 int AddElem(Face * pFace);
47 ListElem * m_pCurElem;
54 void FindFace(IplImage* img);
55 void CreateResults(CvSeq * lpSeq);
57 virtual ~FaceDetection();
58 void SetBoosting(bool bBoosting) {m_bBoosting = bBoosting;}
59 bool isPostBoosting() {return m_bBoosting;}
63 IplImage* m_imgThresh;
65 CvMemStorage* m_mstgContours;
66 CvSeq* m_seqContours[MAX_LAYERS];
67 CvMemStorage* m_mstgRects;
75 void FindContours(IplImage* imgGray);
76 void AddContours2Rect(CvSeq* seq, int color, int iLayer);
77 void ThresholdingParam(IplImage* imgGray, int iNumLayers, int& iMinLevel, int& iMaxLevel, int& iStep);
79 void PostBoostingFindCandidats(IplImage * FaceImage);
82 inline void ReallocImage(IplImage** ppImage, CvSize sz, long lChNum)
90 if (pImage->width != sz.width || pImage->height != sz.height || pImage->nChannels != lChNum)
91 cvReleaseImage( &pImage );
94 pImage = cvCreateImage( sz, IPL_DEPTH_8U, lChNum);
100 #endif // !defined(AFX_FACEDETECTION_H__55865033_D8E5_4DD5_8925_34C2285BB1BE__INCLUDED_)