j2d.face
Class EigenFaceCreator

java.lang.Object
  extended by j2d.face.EigenFaceCreator

public class EigenFaceCreator
extends java.lang.Object

Creates the FaceBundle's from the list of images and tries to match against submitted image.

Version:
1.0
Author:
Konrad Rzeszutek

Field Summary
 double DISTANCE
          Our minimum distance observed for the submitted image in the face-spaces.
static double THRESHOLD
          Our threshold for accepting the matched image.
 int USE_CACHE
          This determines if caching of face-spaces should be activated.
 
Constructor Summary
EigenFaceCreator()
           
 
Method Summary
 java.lang.String checkAgainst(java.io.File f)
          Match against the given file.
 void readFaceBundles(java.io.File rootDir)
          Construct the face-spaces from the given directory.
 double[] readImage(java.io.File f)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THRESHOLD

public static double THRESHOLD
Our threshold for accepting the matched image. Anything above this number is considered as not found in any of the face-spaces.


DISTANCE

public double DISTANCE
Our minimum distance observed for the submitted image in the face-spaces.


USE_CACHE

public int USE_CACHE
This determines if caching of face-spaces should be activated. Anything above zero means yes. Anything else means no.

Constructor Detail

EigenFaceCreator

public EigenFaceCreator()
Method Detail

checkAgainst

public java.lang.String checkAgainst(java.io.File f)
                              throws java.io.FileNotFoundException,
                                     java.io.IOException
Match against the given file.

Returns:
The Identifier of the image in the face-space. If image not found (based on THRESHOLD) null is returned.
Throws:
java.io.FileNotFoundException
java.io.IOException

readFaceBundles

public void readFaceBundles(java.io.File rootDir)
                     throws java.io.FileNotFoundException,
                            java.io.IOException,
                            java.lang.IllegalArgumentException,
                            java.lang.ClassNotFoundException
Construct the face-spaces from the given directory. There must be affineTransform least sixteen images in that directory and each image must have the same dimensions. The face-space bundles are also cached in that directory for speeding up further initialization.

Parameters:
rootDir - The directory where the training images are located.
Throws:
java.io.FileNotFoundException - The rootDir directory does not exist.
java.io.IOException - Problems reading images from the given directory or saving the cache file (if caching is enabled)
java.lang.IllegalArgumentException - The arguments submitted are wrong.
java.lang.ClassNotFoundException - The cached objects are out-of-date or are not this version's face-space objects

readImage

public double[] readImage(java.io.File f)
                   throws java.io.FileNotFoundException,
                          java.lang.IllegalArgumentException,
                          java.io.IOException
Throws:
java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.io.IOException