/* * ExpressionFilterWrapper.h * CERTFramework * * Created by Andrew Salamon on 7/24/06. * Copyright 2006 __MyCompanyName__. All rights reserved. * */ #include #include #include class ExpressionFilter; /** Creates and provides easy use of filters for converting raw expression (AU or smile) data into probabilities. * A list of AU numbers (labels) is passed to the constructor along with an optional directory to find data files. * If no directory is given then the current working directory is used. * For each AU three different files are needed to build a filter. Examples for AU 1 are: * -# AU_1_absent_likelihoods.txt * -# AU_1_present_likelihoods.txt * -# AU_1_noface_likelihoods.txt * For every frame of video or image, call the filterValue method with the AU number (label), the value and a flag telling whether or * or not a face was found. The probability (0.0 - 1.0) will be returned. * If a particular filter wasn't created (file wasn't found, etc) the original value is returned. * There is currently no way to find out if any particular AU is being filtered. * The smile detector is using 101 as its AU number (label). */ class ExpressionFilterWrapper { public: ExpressionFilterWrapper( const std::vector aus, const std::string &dir = "" ); ~ExpressionFilterWrapper(); double filterValue( int AU, double value, bool faceFound ); typedef std::map filterMapType; private: filterMapType filters; };