Facemorph.oesf
Class ORASM

java.lang.Object
  extended by Facemorph.oesf.ORASM

public class ORASM
extends java.lang.Object

An Optimal Response ASM implmentation


Constructor Summary
ORASM()
           
 
Method Summary
 void build(java.lang.String file, java.lang.String tuneFile, HaarReader haar)
          Build an ORASM feature detector
 Template delineate(java.awt.image.BufferedImage bimg, HaarReader haar, Template template, double[] fit, ImageZoomPanel izp)
          Delineate using this ORASM using an exhaustive local search ELS based method
 Template delineate(java.awt.image.BufferedImage bimg, HaarReader haar, Template template, ImageZoomPanel izp)
          Delineate using this ORASM using an exhaustive local search ELS based method
 Template delineateCLM(java.awt.image.BufferedImage bimg, HaarReader haar, Template template, ImageZoomPanel izp)
          Delineate using this ORASM using an constrain local model (CLM) style search
 Template delineateCQF(java.awt.image.BufferedImage bimg, HaarReader haar, Template template, ImageZoomPanel izp)
          Delineate using this ORASM using an convex quadratic fitting (CQF) based method
 Template delineateCQF(java.awt.image.BufferedImage bimg, HaarReader haar, Template template, ImageZoomPanel izp, int iterations, boolean tuning)
          Delineate using this ORASM using an convex quadratic fitting (CQF) based method
 Template getPriorTemplate()
           
static void main(java.lang.String[] args)
          Main method for testing
 void read(java.lang.String folder, java.lang.String name, float maxvar)
          Read an ORASM model
 void tune(java.lang.String file, HaarReader haar)
          Tune the lambda parameters for the model
 void write(java.lang.String folder, java.lang.String name)
          Write an ORASM face detector to disk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ORASM

public ORASM()
Method Detail

build

public void build(java.lang.String file,
                  java.lang.String tuneFile,
                  HaarReader haar)
           throws java.io.FileNotFoundException,
                  java.io.IOException
Build an ORASM feature detector

Parameters:
file - the file listing the training images + templates
tuneFile - file listing the tuning data
haar - the face detector
Throws:
java.io.FileNotFoundException
java.io.IOException

getPriorTemplate

public Template getPriorTemplate()

tune

public void tune(java.lang.String file,
                 HaarReader haar)
          throws java.io.FileNotFoundException
Tune the lambda parameters for the model

Parameters:
file - the list of tuning images and templates
haar - the face detector
Throws:
java.io.FileNotFoundException

write

public void write(java.lang.String folder,
                  java.lang.String name)
           throws java.io.IOException
Write an ORASM face detector to disk

Parameters:
folder - the folder name for storing the model parts
name - the file name for the .orasm file (no extension)
Throws:
java.io.IOException

read

public void read(java.lang.String folder,
                 java.lang.String name,
                 float maxvar)
          throws java.io.IOException
Read an ORASM model

Parameters:
folder - the folder containing the data
name - the orasm description file (no extension)
maxvar - the maximum variance for the shape model to explain
Throws:
java.io.IOException

delineate

public Template delineate(java.awt.image.BufferedImage bimg,
                          HaarReader haar,
                          Template template,
                          ImageZoomPanel izp)
Delineate using this ORASM using an exhaustive local search ELS based method

Parameters:
bimg - the buffered image to detect the features in
haar - the face detector to use
template - the template to use for initialisation (can be null for default initialisation)
izp - the ImageZoomPanel for animating the fitting process
Returns:
returns the estimated Template

delineate

public Template delineate(java.awt.image.BufferedImage bimg,
                          HaarReader haar,
                          Template template,
                          double[] fit,
                          ImageZoomPanel izp)
Delineate using this ORASM using an exhaustive local search ELS based method

Parameters:
bimg - the buffered image to detect the features in
haar - the face detector to use
template - the template to use for initialisation (can be null for default initialisation)
fit - storage space for returning the quality of the fit (sum of feature responses)
izp - the ImageZoomPanel for animating the fitting process
Returns:
returns the estimated Template

delineateCLM

public Template delineateCLM(java.awt.image.BufferedImage bimg,
                             HaarReader haar,
                             Template template,
                             ImageZoomPanel izp)
                      throws PowellException
Delineate using this ORASM using an constrain local model (CLM) style search

Parameters:
bimg - the buffered image to detect the features in
haar - the face detector to use
template - the template to use for initialisation (can be null for default initialisation)
izp - the ImageZoomPanel for animating the fitting process
Returns:
returns the estimated Template
Throws:
PowellException

delineateCQF

public Template delineateCQF(java.awt.image.BufferedImage bimg,
                             HaarReader haar,
                             Template template,
                             ImageZoomPanel izp)
Delineate using this ORASM using an convex quadratic fitting (CQF) based method

Parameters:
bimg - the buffered image to detect the features in
haar - the face detector to use
template - the template to use for initialisation (can be null for default initialisation)
izp - the ImageZoomPanel for animating the fitting process
Returns:
returns the estimated Template

delineateCQF

public Template delineateCQF(java.awt.image.BufferedImage bimg,
                             HaarReader haar,
                             Template template,
                             ImageZoomPanel izp,
                             int iterations,
                             boolean tuning)
Delineate using this ORASM using an convex quadratic fitting (CQF) based method

Parameters:
bimg - the buffered image to detect the features in
haar - the face detector to use
template - the template to use for initialisation (can be null for default initialisation)
izp - the ImageZoomPanel for animating the fitting process
iterations - the number of iterations to perform
tuning - true if we are performing tuning
Returns:
returns the estimated Template

main

public static void main(java.lang.String[] args)
                 throws java.io.FileNotFoundException,
                        java.io.IOException
Main method for testing

Parameters:
args - the args list {list-file, output folder, append string, output file}
Throws:
java.io.FileNotFoundException
java.io.IOException