The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

faceobject.h

Go to the documentation of this file.
00001 /*
00002  *  FACEOBJECT.h
00003  *
00004  *  Created by Bret Fortenberry on Aug 27, 2003.
00005  *  Fixes: 
00006  * 
00007  *  Copyright (c) 2003 Machine Perception Laboratory 
00008  *  University of California San Diego.
00009  * 
00010  * Please read the disclaimer and notes about redistribution 
00011  * at the end of this file.
00012  *  
00013  */
00014 
00015 #ifndef _FACEOBJECT_H_
00016 #define _FACEOBJECT_H_
00017 
00018 #include "visualobject.h"
00019 #include "eyeobject.h"
00020 #include "beyesobject.h"
00021 #include <algorithm>
00022 #include <list>
00023 #include <vector>
00024 #include <math.h>
00025 
00026 
00027 #define EYEMEMSIZE 10000
00028 
00029 enum combine_mode{none=0, average, wt_avg, wt_max, mean_shift, mpi_search, maximum, face_only};
00030 const int num_modes = 8;
00031 const char mode_strings[num_modes][25] = {"none", "average", "wt_avg", "wt_max", "mean_shift", "mpi_search", "maximum", "face_only"};
00032 #define DEFAULT_COMBINE_MODE none
00033 
00034 using namespace std;
00035 
00036 
00037 class FaceObject : public VisualObject
00038 {
00039  public:
00040 
00041   bEyesObject eyes;
00042         vector< EyeObject > leftEyes;
00043         vector< EyeObject > rightEyes;
00044 
00045         FaceObject();
00046         FaceObject(float x_in, float y_in, float xSize_in, float ySize_in, float scale_in);
00047         FaceObject(FaceObject &thelist);
00048         FaceObject(TSquare<float> &square);
00049         FaceObject(list<Square>::iterator face);
00050         ~FaceObject();
00051 
00052         void findMax();
00053         void posterior(combine_mode mode);
00054 
00055         virtual void clear();
00056 
00057 private:
00058         float det3(vector< vector< float > > &matrix);
00059   void TransCof3(vector< vector< float > > &inMtx, vector< vector< float > > &rtnMtx, float det);
00060         bool findOutliers(vector< vector< float > > &meanSub, vector< vector< float > > &invMtx, vector< EyeObject > &Eyes);
00061         int mtxMult(vector< vector< float > > &matrix1, vector< vector< float > > &matrix2, vector< vector< float > > &rtn_matrix);
00062         int mtxMult_2T(vector< vector< float > > &matrix1, vector< vector< float > > &matrix2, vector< vector< float > > &rtn_matrix, float mult = 1.0f);
00063 #ifndef WIN32
00064         int prtMtx(vector< vector< float > > &matrix);
00065 #endif
00066 
00067 };
00068 
00069 
00070 
00071 
00072 #endif
00073 
00074 /*
00075  * 
00076  * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
00077  * 
00078  *    1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
00079  *    2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
00080  *    3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
00081  * 
00082  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00083  * 
00084  */

Generated on Mon Nov 8 17:07:33 2004 for MPT by  doxygen 1.3.9.1