FaceDefinition.java

package ac.essex.ooechs.imaging.commons.cmu; 
 
import ac.essex.ooechs.imaging.commons.Pixel; 
import ac.essex.ooechs.imaging.commons.util.Region; 
import ac.essex.ooechs.imaging.commons.apps.training.strategies.FaceCroppingStrategy; 
 
import java.util.Vector; 
 
/** 
 * 
 * Definition of a face according to the MIT+CMU image set's ground truth: 
 * filename left-eye right-eye nose left-corner-mouth center-mouth right-corner-mouth 
 * 
 * @author Olly Oechsle, University of Essex, Date: 29-Sep-2006 
 * @version 1.0 
 */ 
public class FaceDefinition { 
 
    protected String filename; 
    protected Pixel leftEye; 
    protected Pixel rightEye; 
    protected Pixel nose; 
    protected Pixel leftCornerMouth; 
    protected Pixel centerMouth; 
    protected Pixel rightCornerMouth; 
 
    public FaceDefinition(String filename, Pixel leftEye, Pixel rightEye, Pixel nose, Pixel leftCornerMouth, Pixel centerMouth, Pixel rightCornerMouth) { 
        this.filename = filename; 
        this.leftEye = leftEye; 
        this.rightEye = rightEye; 
        this.nose = nose; 
        this.leftCornerMouth = leftCornerMouth; 
        this.centerMouth = centerMouth; 
        this.rightCornerMouth = rightCornerMouth; 
    } 
 
    public String getFilename() { 
        return filename; 
    } 
 
    public Pixel getLeftEye() { 
        return leftEye; 
    } 
 
    public Pixel getRightEye() { 
        return rightEye; 
    } 
 
    public Pixel getNose() { 
        return nose; 
    } 
 
    public Pixel getLeftCornerMouth() { 
        return leftCornerMouth; 
    } 
 
    public Pixel getCenterMouth() { 
        return centerMouth; 
    } 
 
    public Pixel getRightCornerMouth() { 
        return rightCornerMouth; 
    } 
 
    public Region getRegion() { 
 
        Vector<Pixel> nodes = new Vector<Pixel>(2); 
        nodes.add(leftEye); 
        nodes.add(rightEye); 
        return new FaceCroppingStrategy().getCropRegion(nodes); 
 
    } 
 
}