18.03.2014 Views

Recognition of facial expressions - Knowledge Based Systems ...

Recognition of facial expressions - Knowledge Based Systems ...

Recognition of facial expressions - Knowledge Based Systems ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

o call a specialized routine for computing the probability <strong>of</strong> existence <strong>of</strong><br />

current parameter being in current state, given the parent parameters<br />

being in the states specified through the current combination<br />

o fills in the data in the Conditional Probability Table (CPT) <strong>of</strong> the<br />

current parameter<br />

- saves the data on the disk, in a file having the same name as the input file. The<br />

difference is that the saved model has the data in parameter CPTs.<br />

In order to be able to query the program for obtaining the probability associated to a<br />

certain state <strong>of</strong> the parameters, a C++ class tackles the data within the chosen<br />

parametric model (Listing 9).<br />

//---------------------------------------------------<br />

1: class model<br />

2: {<br />

3: public:<br />

4: file a[1000];<br />

5: int n;<br />

6: int NP; //no.<strong>of</strong> parameters<br />

7: int NC; //no.<strong>of</strong> classes<br />

8: public:<br />

9: model():n(0){}<br />

10: bool readDatabase(char*);<br />

11: void show(void);<br />

12: float computeP(cere&);<br />

13: float computeP2(cere2&);<br />

14: float computeP3(int,char*);<br />

15: float computeP4(int,char*,bool);<br />

16: int countExpression(char*);<br />

17: bool isIncluded(FACS&,FACS&);<br />

18: void select(query&,model&);<br />

19: void emptyDatabase(void){n=0;}<br />

20: int countFields(void){return n;}<br />

21: int getClass(int,int);<br />

22: void save(char*);<br />

23: char* getFieldExpression(int);<br />

24: private:<br />

25: float compare(FACS&,FACS&);<br />

26: void insertField(int,int,FACS&,char*);<br />

27: };<br />

//---------------------------------------------------<br />

Listing 9. C++ class to handle the model data<br />

The class is used to manage all the processing on the data and to store the data related to<br />

the sample data from the initial sample database. An instance <strong>of</strong> the structure “file” stores<br />

internally the Action Units sequence, the description <strong>of</strong> the <strong>facial</strong> emotion and the value<br />

<strong>of</strong> the parameters. The definition is given in Listing 10.<br />

- 77 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!