00001 /*M/////////////////////////////////////////////////////////////////////////////////////// 00002 // 00003 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 00004 // 00005 // By downloading, copying, installing or using the software you agree to this license. 00006 // If you do not agree to this license, do not download, install, 00007 // copy or use the software. 00008 // 00009 // 00010 // Intel License Agreement 00011 // For Open Source Computer Vision Library 00012 // 00013 // Contributors License Agreement 00014 // 00015 // Copyright (C) 2006, Zecchini Fabio, all rights reserved. 00016 // 00017 // Copyright (C) 2006, Cora' Massimo, all rights reserved. Code adapting and integration into Omnimeeting. 00018 // 00019 // Third party copyrights are property of their respective owners. 00020 // 00021 // Redistribution and use in source and binary forms, with or without modification, 00022 // are permitted provided that the following conditions are met: 00023 // 00024 // * Redistribution's of source code must retain the above copyright notice, 00025 // this list of conditions and the following disclaimer. 00026 // 00027 // * Redistribution's in binary form must reproduce the above copyright notice, 00028 // this list of conditions and the following disclaimer in the documentation 00029 // and/or other materials provided with the distribution. 00030 // 00031 // * The name of Intel Corporation may not be used to endorse or promote products 00032 // derived from this software without specific prior written permission. 00033 // 00034 // This software is provided by the copyright holders and contributors "as is" and 00035 // any express or implied warranties, including, but not limited to, the implied 00036 // warranties of merchantability and fitness for a particular purpose are disclaimed. 00037 // In no event shall the Intel Corporation or contributors be liable for any direct, 00038 // indirect, incidental, special, exemplary, or consequential damages 00039 // (including, but not limited to, procurement of substitute goods or services; 00040 // loss of use, data, or profits; or business interruption) however caused 00041 // and on any theory of liability, whether in contract, strict liability, 00042 // or tort (including negligence or otherwise) arising in any way out of 00043 // the use of this software, even if advised of the possibility of such damage. 00044 // 00045 //M*/ 00046 00047 #ifndef _CVFACEDETECT_H_ 00048 #define _CVFACEDETECT_H_ 00049 00050 00052 // 00053 // Mouth and eye detection based on the paper: 00054 // 00055 // P. Campadelli, F. Cusmai, and R. Lanzarotti, A color-based method for face detection 00056 // http://homes.dsi.unimi.it/%7Ecampadel/Articoli/IST2003.pdf 00057 // 00059 00060 #include <cv.h> 00061 #include <highgui.h> 00062 #include "CvVRFilter.hh" 00063 00064 00065 //#define MOUTH 00066 //#define EYES 00067 #define DETECT 00068 00072 #define DRAW_NONE 0 00073 00077 #define DRAW_BOX_ONLY 1 00078 00082 #define DRAW_EYES 2 00083 00086 #define DRAW_MOUTH 3 00087 00091 #define DRAW_ALL 4 00092 00093 00094 00095 // 00096 // **** IMPORTANT NOTE **** 00097 // if your application won't work with current values please look into 00098 // CvFaceDetect.cpp and adjust values near 00099 // "CHANGE THIS PARAMETER SPECIFIC FOR YOUR APPLICATION POURPOSE" mark. 00100 // 00101 00102 00109 class CvFaceDetect 00110 { 00112 IplImage *source ; 00114 IplImage *ycc , *y ; 00116 CvSize size; 00117 00119 CvSeq *contour; 00121 CvMemStorage *storage ; 00122 00124 CvVrFilter *vrfilter; 00126 IplImage *skin_locus_map; 00127 00129 IplImage *mouth_map ; 00131 IplImage *mouth_map_bin; 00132 00134 IplImage *eyes_map ; 00136 IplImage *eyes_map_bin; 00137 00139 bool started; 00140 00141 public: //function 00142 00144 00150 CvFaceDetect(int min = 0, int max = 10000); 00151 00153 virtual ~CvFaceDetect(); 00154 00156 00162 void cvFaceDetect(IplImage * image, int DRAW_TYPE = 0); 00163 00164 public: //data 00165 00167 CvSeq *faces; 00168 00169 private: //function 00170 00172 00176 void icvMouthMap(IplImage * image); 00178 00181 void icvMouthMask(); 00183 00187 void icvMouthDetect(); 00188 00190 00194 void icvEyesMap(IplImage * image); 00196 00199 void icvEyesMask(); 00201 00205 void icvEyesDetect(); 00206 00208 00213 void icvMouthEyesMap(IplImage * image); 00215 00218 void icvMouthEyesMask(); 00220 00224 void icvMouthEyesDetect(); 00225 00226 }; 00227 00228 #endif /*_CVFACEDETECT_H_*/