Facemorph.haar
Class FeatureFinder

java.lang.Object
  extended by Facemorph.haar.FeatureFinder

public class FeatureFinder
extends java.lang.Object

Experimental method for finding features, I suppose


Constructor Summary
FeatureFinder()
           
 
Method Summary
 java.awt.geom.Point2D.Double[] eyeRect(Face face, float ratio, boolean left, int baseWidth, int baseHeight)
          Estimates a search box for the eyes given the face rectangle
 java.awt.geom.Point2D.Double[] findFeatures(java.awt.image.BufferedImage image, java.lang.String[] cascades)
          Find the feature in the image using the cascades named
static Face getBiggest(java.util.List<Face> faces)
          Get the biggest from the list
 java.util.List<Face> haarDetect(BufferedImg img, HaarReader haar, int xstart, int ystart, int width, int height)
          Haar detector
static void main(java.lang.String[] args)
          Main method for testing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureFinder

public FeatureFinder()
Method Detail

findFeatures

public java.awt.geom.Point2D.Double[] findFeatures(java.awt.image.BufferedImage image,
                                                   java.lang.String[] cascades)
Find the feature in the image using the cascades named

Parameters:
image - the image to search
cascades - the cascades to use {face, lefteye, righteye}
Returns:
returns the locations

haarDetect

public java.util.List<Face> haarDetect(BufferedImg img,
                                       HaarReader haar,
                                       int xstart,
                                       int ystart,
                                       int width,
                                       int height)
Haar detector

Parameters:
img - the image to search
haar - the haar detector
xstart - the x start of the search rectangle
ystart - the y start of the search rectangle
width - the width of the search rectangle
height - the height of the search rectangle
Returns:
returns the list of detected objects

getBiggest

public static Face getBiggest(java.util.List<Face> faces)
Get the biggest from the list

Parameters:
faces - the list of object locations / sizes
Returns:
returns the biggest

eyeRect

public java.awt.geom.Point2D.Double[] eyeRect(Face face,
                                              float ratio,
                                              boolean left,
                                              int baseWidth,
                                              int baseHeight)
Estimates a search box for the eyes given the face rectangle

Parameters:
face - the detected face box
ratio - seems to indicate how far down the face the eye box should start (as a fraction)
left - if true left eye, otherwise right eye
baseWidth - the basic width of the face rectange (ignores the scale)
baseHeight - the basic height of the face rectange (ignores the scale)
Returns:
the eye rectangle as the two corners

main

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

Parameters:
args - the program args
Throws:
java.io.IOException