Face recognition based on Eigenfaces for Urbi. Eigenfaces are a set of eigenvectors used in the computer vision problem of human face recognition.

Module functions

UEigenfaces.init(); - initialize module
UEigenfaces.loadData("fileName.xml"); - load database from file
UEigenfaces.saveData("fileName.xml"); - save database to file
UEigenfaces.train(image, "label"); - add image with label to database
UEigenfaces.updateDatabase(componentsCount); - update database by added images, PCA componetsCount stays for the number of significant elements that should be taken into the consideration
UEigenfaces.find(image); - classify image based on the database, returns label
UEigenfaces.getFacesCount(); - return the total number of labels availabe in the database
UEigenfaces.getFacesNames(); - return labels available in database
UEigenfaces.getFaceImagesCount("name"); - return number of images for given label
UEigenfaces.getFaceImage("name", number); - return image with given label and number
UEigenfaces.getImageWidth(); - return image width
UEigenfaces.getImageHeight(); - return image height
UEigenfaces.getTestFace("fileName"); - load image from file
UEigenfaces.threshold(); - threshold level used for finding label for given image

Urbiscript examples

var Global.Eigenfaces =;
// Learning face from object (face) detector
 Eigenfaces.train(objectDetector.object, "jan"); 
return Eigenfaces.updateDatabase(80);
Eigenfaces.threshold=Eigenfaces.threshold*2; // adjust threshold
// Recognizing face from object (face) detector 
return Eigenfaces.find(objectDetector.object);





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

FLASH Documentation