j2d.face
Class FaceBundle

java.lang.Object
  extended by j2d.face.FaceBundle
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class FaceBundle
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

The face-space bundle generated by EigenFaceComputation. This bundle has all the relevant information to try to match an image The computation to be done (to find the submitted image in this bundles face-space) is q?uite fast. For more about the algorithm, consult ( http://www.cs.ucsb.edu/~mturk/Papers/mturk-CVPR91.pdf"> http://www.cs.ucsb.edu/~mturk/Papers/mturk-CVPR91.pdf) Each FaceBundle contains sixteen images and their identifying string.
NOTE: This object is serializable, therefere its possible to cache these face-spaces thus eliminating the computation process in EigenFaceComputation.

Version:
1.0
Author:
Konrad Rzeszutek
See Also:
Serialized Form

Field Summary
 int length
          The length of the vector-images stored in the face-space bundle.
 
Constructor Summary
FaceBundle(double[] avgF, double[][] wk, double[][] eigV, java.lang.String[] files)
          The face-space object containing: An average face array.
 
Method Summary
 void clearFace()
          Clear the submitted image from the face-space object.
 int compareTo(java.lang.Object o)
          Compare this face-space bundle to another.
 double distance()
          The distance of how far away the submitted image is in this face-space object.
 java.lang.String getID()
          The ID of the submitted image in this face-space object.
 java.lang.String[] getNames()
          All the names of the images in this face-space.
 void submitFace(byte[] face)
          Submit an image of matching against the face-space.
 void submitFace(double[] face)
          Submit an image of matching against the face-space.
 void submitFace(int[] face)
          Submit an image of matching against the face-space.
 java.lang.String toString()
          Get a string representation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

length

public int length
The length of the vector-images stored in the face-space bundle. The submitted image MUST of the same length or greater (if its greater only length will be considered).

Constructor Detail

FaceBundle

public FaceBundle(double[] avgF,
                  double[][] wk,
                  double[][] eigV,
                  java.lang.String[] files)
The face-space object containing:
  1. An average face array.
  2. Eigenspace of images
  3. Face space of images
  4. List of names identifying each image

Parameters:
avgF - Average face (used to normalize the image to be matched against)
wk - The eigenface componenets (projected onto the eigenspace)
eigV - The eigenspace (onto which the matched image will be projected too)
files - A String array representing each of the sixteen images represented by this face-space.
Method Detail

submitFace

public void submitFace(byte[] face)
Submit an image of matching against the face-space. The results are published in distance() and getID().

Parameters:
face - The vector-array of the image. The image must be off length

submitFace

public void submitFace(int[] face)
Submit an image of matching against the face-space. The results are published in distance() and getID().

Parameters:
face - The vector-array of the image. The image must be off length

submitFace

public void submitFace(double[] face)
Submit an image of matching against the face-space. The results are published in distance() and getID().

Parameters:
face - The vector-array of the image. The image must be off length

clearFace

public void clearFace()
Clear the submitted image from the face-space object.


distance

public double distance()
The distance of how far away the submitted image is in this face-space object. Consult getID() for the name of the image that it was most near too.

Returns:
>= 0 or if no image has been submitted: Double.MAX_VALUE

getID

public java.lang.String getID()
The ID of the submitted image in this face-space object.

Returns:
A string, but if no image has been submitted a ArrayOutOfBoundException

getNames

public java.lang.String[] getNames()
All the names of the images in this face-space.

Returns:
getNames().length == 16

compareTo

public int compareTo(java.lang.Object o)
Compare this face-space bundle to another. If this bundle has a smaller distance than the other, -1 is returned. 1 if its opposite. NOTE: There is no checking if the other face-space bundle has computed its values for the same image.

Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Get a string representation.

Overrides:
toString in class java.lang.Object