LATEST VERSION 2.1 (27.02.2012)

Description

FacET (Facial Expression Tracker) is a library of image processing procedures for detecting and parameterizing face components (eg. eyes, eyebrows, lips, forehead wrinkles). Such features are useful for classification of human emotions based on facial expression.

facet

Configuration

Set correct cascades paths in default.cfg file
Example paths to Haar classifier cascades
FACE_PATH cascades/haarcascade_frontalface_alt.xml
R_EYE_PATH cascades/eyes/thing_shan_eye_cascade.xml
L_EYE_PATH cascades/eyes/thing_shan_eye_cascade.xml
MOUTH_PATH cascades/mouth/Mouth.xml
NOSE_PATH cascades/nose/Nariz.xml

Module functions

UFacet.new(&image); - initialize with image source
UFacet.mode; - set detector mode
mode 0 - you have to get image then call detector function manually (see example 1)
mode 1 - get image manually in a loop (see example 2)
mode 2 - use input port data-flow (see example 3)
UFacet.image; - access to UImage variable, you can also see the image in Urbi console
UFacet.width; - image width (determined by scale)
UFacet.height; - image height (determined by scale)
UFacet.scale; - set image scale for processing
UFacet.time; - processing time
UFacet.fps; - algorithm performance
UFacet.input; - object input (use in mode 3 only)
UFacet.SetImage(image); - use this function to detect an object manually; you can run this function in background
UFacet.faces; - number of detected faces
UFacet.roix[]; - list of face X coordinate (pixels)
UFacet.roiy[]; - list of face Y coordinate (pixels)
UFacet.angle[]; - list of face declination angle (not verified, for future use)
UFacet.LEbBnd[]; - list of left eyebrow bend angle (top)
UFacet.LEbDcl[]; - list of left eyebrow declination angle (side)
UFacet.LEyOpn[]; - list of distance between the right eyelids (rel. eyeball subregion)
UFacet.LEbHgt[]; - list of distance between left pupil and eyebrow top (rel. eye subregion)
UFacet.REbBnd[]; - list of right eyebrow bend angle (top)
UFacet.REbDcl[]; - list of right eyebrow declination angle (side)
UFacet.REyOpn[]; - list of distance between the right eyelids (rel. eyeball subregion)
UFacet.REbHgt[]; - list of distance between right pupil and eyebrow top (rel. eye subregion)
UFacet.LiAspt[]; - list of aspect ratio of the lips bounding box (percents)
UFacet.LLiCnr[]; - list of Y position of the left corner of the lips (rel. lips bounding box)
UFacet.RLiCnr[]; - list of Y position of the right corner of the lips (rel. lips bounding box)
UFacet.Wrnkls[]; - list of number of horizontal wrinkles in the center of the forehead
UFacet.Nstrls[]; - list of nostrils baseline width (rel. face width)
UFacet.TeethA[]; - list of area of the visible teeth (rel. lips bounding box)

Urbiscript examples

Example 1

loadModule("UCamera");
var Global.Cam=UCamera.new(0);
loadModule("UFacet");
var Global.Facet=UFacet.new(Global.Cam.&image);
Facet.scale=1;
Facet.loadSettings("default.cfg")
 
t: loop {
Global.Cam.GetImage();
Global.Facet.SetImage(Global.Cam.image);
},
 
Facet.image; // display an image 
// display parameters of first face
if (Facet.faces>0){
echo(Facet.roix[0]);
echo(Facet.roiy[0]);
echo(Facet.angle[0]);
echo(Facet.LEbBnd[0]);
echo(Facet.LEbDcl[0]);
echo(Facet.LEyOpn[0]);
echo(Facet.LEbHgt[0]);
echo(Facet.REbBnd[0]);
echo(Facet.REbDcl[0]);
echo(Facet.REyOpn[0]);
echo(Facet.REbHgt[0]);
echo(Facet.LiAspt[0]);
echo(Facet.LLiCnr[0]);
echo(Facet.RLiCnr[0]);
echo(Facet.Wrnkls[0]);
echo(Facet.Nstrls[0]);
echo(Facet.TeethA[0]);
};

Example 2

loadModule("UCamera");
var Global.Cam=UCamera.new(0);
loadModule("UFacet");
var Global.Facet=UFacet.new(Global.Cam.&image);
Facet.mode=1;
Facet.scale=1;
Facet.loadSettings("default.cfg");
 
t: loop {
Global.Cam.GetImage();
},  
 
Facet.image; // display an image 
// display parameters of first face 
if (Facet.faces>0){ 
echo(Facet.roix[0]); 
echo(Facet.roiy[0]);
echo(Facet.angle[0]); 
echo(Facet.LEbBnd[0]);
echo(Facet.LEbDcl[0]); 
echo(Facet.LEyOpn[0]); 
echo(Facet.LEbHgt[0]);
echo(Facet.REbBnd[0]); 
echo(Facet.REbDcl[0]); 
echo(Facet.REyOpn[0]); 
echo(Facet.REbHgt[0]); 
echo(Facet.LiAspt[0]); 
echo(Facet.LLiCnr[0]);
echo(Facet.RLiCnr[0]);
echo(Facet.Wrnkls[0]); 
echo(Facet.Nstrls[0]); 
echo(Facet.TeethA[0]);
}; 

Example 3

loadModule("UCamera");
var Global.Cam=UCamera.new(0);
Global.Cam.notify=1;
loadModule("UFacet");
var Global.Facet=UFacet.new(Global.Cam.&image);
Facet.mode=2;
Facet.scale=1;
Facet.loadSettings("default.cfg");
 
var Conn = Global.Cam.&image >> Global.Facet.&input;
 
Facet.image; // display an image 
// display parameters of first face 
if (Facet.faces>0){ 
echo(Facet.roix[0]); 
echo(Facet.roiy[0]);
echo(Facet.angle[0]); 
echo(Facet.LEbBnd[0]);
echo(Facet.LEbDcl[0]); 
echo(Facet.LEyOpn[0]); 
echo(Facet.LEbHgt[0]);
echo(Facet.REbBnd[0]); 
echo(Facet.REbDcl[0]); 
echo(Facet.REyOpn[0]); 
echo(Facet.REbHgt[0]); 
echo(Facet.LiAspt[0]); 
echo(Facet.LLiCnr[0]);
echo(Facet.RLiCnr[0]);
echo(Facet.Wrnkls[0]); 
echo(Facet.Nstrls[0]); 
echo(Facet.TeethA[0]);
}; 

Download

 LINK

 

 

EMYS and FLASH are Open Source and distributed according to the GPL v2.0 © Rev. 0.9.1, 15.05.2017

FLASH Documentation