Facemorph.oesf
Class ORASM3D

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

public class ORASM3D
extends java.lang.Object

3D Orasm implementation


Constructor Summary
ORASM3D()
           
 
Method Summary
 void batchDelineate(java.lang.String file, java.lang.String append)
          Batch delineation method
 Template3D delineate(java.awt.image.BufferedImage bimg, Template template, ImageZoomPanel izp, boolean combine, boolean weighted, int iterations)
          Delineate an image using this 3D ORASM model
static void main(java.lang.String[] args)
          Main method used for testing
 void read(java.lang.String folder, java.lang.String name, HaarReader haar)
          Read an orasm 3d from file
static Template to2D(Template3D t3d, java.util.ArrayList<java.lang.Boolean> active)
          Convert a 3D template to a 2d one
static BigMat toRotation(BigMat M)
          Projects M into a valid roation matrix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ORASM3D

public ORASM3D()
Method Detail

read

public void read(java.lang.String folder,
                 java.lang.String name,
                 HaarReader haar)
          throws java.io.IOException
Read an orasm 3d from file

Parameters:
folder - the folder to read from
name - the name of the file to read
haar - the HaarReader object to detect faces
Throws:
java.io.IOException

delineate

public Template3D delineate(java.awt.image.BufferedImage bimg,
                            Template template,
                            ImageZoomPanel izp,
                            boolean combine,
                            boolean weighted,
                            int iterations)
Delineate an image using this 3D ORASM model

Parameters:
bimg - the buffered image to search
template - used to store the output 2D template
izp - the image zoom panel to animate the search
combine - if true tries with all views and pcks the best
weighted - if weighted the maximum response is used to weight the vote in favour of the highest responding filter set
iterations - the number of iterations (not currently used)
Returns:
returns the estimate of the 3d template

to2D

public static Template to2D(Template3D t3d,
                            java.util.ArrayList<java.lang.Boolean> active)
Convert a 3D template to a 2d one

Parameters:
t3d - the input 3D template
active - the active points to use
Returns:
returns a 2D version of the template made by dropping the z coords

toRotation

public static BigMat toRotation(BigMat M)
Projects M into a valid roation matrix

Parameters:
M - the un-normalised estimate of the rotation
Returns:
returns the rotation matrix

batchDelineate

public void batchDelineate(java.lang.String file,
                           java.lang.String append)
                    throws java.io.FileNotFoundException,
                           java.io.IOException
Batch delineation method

Parameters:
file - the file listing the images to delineate
append - the string to append to the delineated results
Throws:
java.io.FileNotFoundException
java.io.IOException

main

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

Parameters:
args - if args[0] image of list file name, args[1] haar cascade, args[2] orasm3d folder, args[3] orasm3d file name, args[4] string to append to output (if in batch mode)
Throws:
java.io.FileNotFoundException
java.io.IOException