Facemorph
Class MultiscaleInterpolate

java.lang.Object
  extended by Facemorph.MultiscaleInterpolate

public class MultiscaleInterpolate
extends java.lang.Object

Implements a multi-scale interpolation algorithm


Constructor Summary
MultiscaleInterpolate(int w, int h)
          Creates a multi-scale warping object of the specified (equal input and output) dimensions
 
Method Summary
 float get(int x, int y)
          return the value of the warping function at the specified position
 boolean interpolate(FloatImage mask, FloatImage data)
          Interpolates the data using the mask to specify valid samples
 boolean interpolate(java.awt.geom.Point2D.Float[] source, float[] vals)
          Interpolates the given 2D values across the 2D space, by performing setup then calling interpolate()
 float sample(float x, float y)
          Sample from this interpolation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiscaleInterpolate

public MultiscaleInterpolate(int w,
                             int h)
Creates a multi-scale warping object of the specified (equal input and output) dimensions

Parameters:
w - The desired width
h - The desired height
Method Detail

interpolate

public boolean interpolate(FloatImage mask,
                           FloatImage data)
Interpolates the data using the mask to specify valid samples

Parameters:
mask - the mask specifies valid samples
data - the data specifies the interpolation constraints
Returns:
returns true if the interpolation is successful

interpolate

public boolean interpolate(java.awt.geom.Point2D.Float[] source,
                           float[] vals)
Interpolates the given 2D values across the 2D space, by performing setup then calling interpolate()

Parameters:
vals - the values of the interpolation constraints
source - The array of start point locations
Returns:
true of the interpolation was successful, false otherwise

get

public float get(int x,
                 int y)
return the value of the warping function at the specified position

Parameters:
x - The x-coordinate
y - The y-coordinate
Returns:
A float array of 2 containing the x and y value of the warp.

sample

public float sample(float x,
                    float y)
Sample from this interpolation

Parameters:
x - x-coord to sample at
y - y-coord to sample at
Returns:
the value of this function at (x,y)