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.

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

1: struct file<br />

2: {<br />

3: int nsubj;<br />

4: int nscene;<br />

5: FACS facs;<br />

6: char expr[100];<br />

7: float param[50];<br />

8: };<br />

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

Listing 10. Data structure to store the information related to one sample<br />

Each Action Unit sequence is handled separately by using a structure that is defined in<br />

Listing 11. It also contains some routines for easily converting from a character structure,<br />

to efficiently copy data from another similar structure and to check for the existence <strong>of</strong><br />

some condition.<br />

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

1: struct FACS<br />

2: {<br />

3: int n;<br />

4: unsigned char a[30][3];<br />

5: void assign(char*);<br />

6: void copyFrom(FACS&);<br />

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

8: bool Is(int,int);<br />

9: bool containAU(int);<br />

10: };<br />

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

Listing 11. The internal structure to handle the AU sequence <strong>of</strong> one sample<br />

A query is encoded in a structure that is shown in<br />

Listing 12. It can be used for computing the probability <strong>of</strong> any expression, given the state<br />

<strong>of</strong> existence/absence <strong>of</strong> the Aus from the set.<br />

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

1: #define MAXQUERYLEN 50<br />

2: struct query<br />

3: {<br />

4: char expr[100];<br />

5: bool swexpr;<br />

6: bool neg_expr;<br />

7: bool neg[MAXQUERYLEN];<br />

8: FACS f[MAXQUERYLEN];<br />

9: int n;<br />

10:<br />

11: query():n(0),swexpr(false),neg_expr(false){};<br />

12: bool add(char*e,bool sw_n=true);<br />

13: void empty(void){n=0;neg_expr=false;swexpr=false;}<br />

14: };<br />

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

Listing 12. The structure <strong>of</strong> a query<br />

- 78 -

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

Saved successfully!

Ooh no, something went wrong!