Facemorph
Class Transformer

java.lang.Object
  extended by Facemorph.Transformer

public class Transformer
extends java.lang.Object

Class to perform prototype (average) based transformations on images.


Constructor Summary
Transformer()
           
 
Method Summary
static java.awt.Image averageImages(java.awt.Image[] images, Template[] templates, Template averageTemplate, int outW, int outH, java.awt.image.ImageObserver obs, boolean autoSize, int normalisation)
          Average a set of images
static java.awt.Image averageImages(java.awt.Image[] images, Template[] templates, Template averageTemplate, int outW, int outH, java.awt.image.ImageObserver obs, boolean autoSize, int normalisation, TransformerListener warpListener, TransformerListener averageListener)
          Method to create an average from a set of delineated images.
static java.awt.Image averageImagesTexture(java.awt.Image[] images, Template[] templates, Template averageTemplate, int outW, int outH, Filter[] filters, int bm, java.awt.image.ImageObserver obs, boolean autoSize, int normalisation)
          Method to create an average from a set of delineated images.
static java.awt.Image averageImagesTexture(java.awt.Image[] images, Template[] templates, Template averageTemplate, int outW, int outH, Filter[] filters, int bm, java.awt.image.ImageObserver obs, boolean autoSize, int normalisation, TransformerListener warpListener, TransformerListener averageListener)
          Method to create an average from a set of delineated images.
static java.awt.image.BufferedImage caricatureChimeric(java.awt.image.BufferedImage subImg, java.awt.image.BufferedImage cimg1, java.awt.image.BufferedImage cimg2, Template tmplt, float l1, float l2, float wid)
          Half face transform on the image (no warping)
static java.awt.image.BufferedImage ImageToBufferedImage(java.awt.Image img, java.awt.image.ImageObserver iob)
          Converts an abstract (unknown type of) Image to a BufferedImage for extra functionality.
static void mask(Template newTemplate, MaskInterface mask, java.awt.image.BufferedImage warped, java.awt.image.BufferedImage transformed)
          MaskInterface the colour changes to the array specified
static java.util.Vector<java.awt.Image> morph(java.awt.Image img1, Template tmp1, java.awt.Image img2, Template tmp2, int steps, java.awt.image.ImageObserver ob, boolean fast)
          Creates a Morph between two delineated images
static java.util.Vector<java.awt.Image> morph(java.awt.Image img1, Template tmp1, java.awt.Image img2, Template tmp2, int steps, java.awt.image.ImageObserver ob, boolean fast, java.util.Vector<Template> templates, TransformerListener listener)
          Creates a Morph between two delineated images
static void normaliseColours(Template newTemplate, MaskInterface mask, java.awt.image.BufferedImage warped, java.awt.image.BufferedImage transformed)
          Normalise the mean and standard deviation of colours in the masked area
static java.awt.image.BufferedImage shiftColours(java.awt.image.BufferedImage subImg, java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst, double amount)
          Perform the colour shifting part of the transform
static java.awt.image.BufferedImage testTransform(int warpType, Template subTem, Template srcTem, Template dstTem, Template outTem, java.awt.image.BufferedImage subImg, java.awt.image.BufferedImage srcImg, java.awt.image.BufferedImage dstImg, double shapeAmount, double colourAmount, double textureAmount, Filter[] filters, int bm, MaskInterface mask, boolean samples, boolean borders, boolean matchCols, int normalisation, int[] normPoints)
          Face transform method, more modular version
static java.awt.image.BufferedImage testTransform(int warpType, Template subTem, Template srcTem, Template dstTem, Template outTem, java.awt.Image subImg, java.awt.Image srcImg, java.awt.Image dstImg, double shapeAmount, double colourAmount, double textureAmount, Filter[] filters, int bm, MaskInterface mask, boolean samples, boolean borders, boolean matchCols, int normalisation, int[] normPoints)
          Face transform method, more modular version
static java.awt.image.BufferedImage textureTransform(java.awt.image.BufferedImage orig, java.awt.image.BufferedImage sub, java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst, Filter[] filters, int bm, double amount)
          Performs a texture (wavelet magnitude) transform on the image
static java.awt.Image transform(Template subjectTemplate, Template sourceTemplate, Template destTemplate, Template newTemplate, java.awt.Image subjectImg, java.awt.Image sourceImg, java.awt.Image destImg, double shape, double colour, double texture, java.awt.image.ImageObserver ob, MaskInterface mask, Filter[] filters, int bm, boolean fast, boolean conts)
          Transforms subjectImage using the prototypes given and returns the result.
static java.awt.Image transform(Template subjectTemplate, Template sourceTemplate, Template destTemplate, Template newTemplate, java.awt.Image subjectImg, java.awt.Image sourceImg, java.awt.Image destImg, double s, java.awt.image.ImageObserver ob, boolean fast)
          Transforms subjectImage using the prototypes given and returns the result.
static java.awt.Image transform(Template subjectTemplate, Template sourceTemplate, Template destTemplate, Template newTemplate, java.awt.Image subjectImg, java.awt.Image sourceImg, java.awt.Image destImg, double s, java.awt.image.ImageObserver ob, MaskInterface mask, boolean fast)
          Transforms subjectImage using the prototypes given and returns the result.
static java.awt.Image transformBald(Template subjectTemplate, Template avTemplate, Template rotAvTemplate, Template baldAvTemplate, Template rotBaldAvTemplate, Template hairAvTemplate, Template rotHairAvTemplate, Template newTemplate, java.awt.Image subjectImg, java.awt.Image sourceImg, java.awt.Image destImg, double s, java.awt.image.ImageObserver ob, boolean colour, boolean fast)
          Transforms subjectImage using the prototypes given and returns the result.
static java.awt.image.BufferedImage transformChimeric(int warpType, Template subTem, Template srcTem, Template dstTem, Template outTem, java.awt.image.BufferedImage subImg, java.awt.image.BufferedImage srcImg, java.awt.image.BufferedImage dstImg, float leftAmount, float rightAmount, float width, boolean samples, boolean borders)
          Half face transform method
static java.awt.image.BufferedImage warp(int warpType, java.awt.image.BufferedImage bimg, Template start, Template end, int outW, int outH, boolean samples, boolean borders)
          Image warp method
static FloatImage warp(int warpType, FloatImage fimg, Template start, Template end, int outW, int outH, boolean samples, boolean borders)
          Image warp method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transformer

public Transformer()
Method Detail

transform

public static java.awt.Image transform(Template subjectTemplate,
                                       Template sourceTemplate,
                                       Template destTemplate,
                                       Template newTemplate,
                                       java.awt.Image subjectImg,
                                       java.awt.Image sourceImg,
                                       java.awt.Image destImg,
                                       double s,
                                       java.awt.image.ImageObserver ob,
                                       boolean fast)
Transforms subjectImage using the prototypes given and returns the result. The transformed Template is returned in newTemplate. The transformation follows the formula: new = subject + s*(dest-source)

Parameters:
subjectTemplate - The Template outlining the features of subjectImg
sourceTemplate - The (average) Template outlining the features of sourceImg
destTemplate - The (average) Template outlining the features of destImg
newTemplate - Template to hold the Template corresponding to the transformed result. Useful for morphing afterwards.
subjectImg - The Image to transform
sourceImg - The (average) image of the source group
destImg - The (average) image of the destination group
s - The amount to scale this transform by. 0 = no transform, 1= complete transform.
ob - An ImageObserver used for obtaining Image sizes
fast - Flag indicating whether to use (fast?) linear warping with no sampling along the contours, or (slow?) multi-scale warping with full contour sampling.
Returns:
The transformed image.

transform

public static java.awt.Image transform(Template subjectTemplate,
                                       Template sourceTemplate,
                                       Template destTemplate,
                                       Template newTemplate,
                                       java.awt.Image subjectImg,
                                       java.awt.Image sourceImg,
                                       java.awt.Image destImg,
                                       double shape,
                                       double colour,
                                       double texture,
                                       java.awt.image.ImageObserver ob,
                                       MaskInterface mask,
                                       Filter[] filters,
                                       int bm,
                                       boolean fast,
                                       boolean conts)
Transforms subjectImage using the prototypes given and returns the result. The transformed Template is returned in newTemplate. The transformation follows the formula: new = subject + s*(dest-source)

Parameters:
mask - The MaskInterface object defining the boundary of the masked region.
subjectTemplate - The Template outlining the features of subjectImg
sourceTemplate - The (average) Template outlining the features of sourceImg
destTemplate - The (average) Template outlining the features of destImg
newTemplate - Template to hold the Template corresponding to the transformed result. Useful for morphing afterwards.
subjectImg - The Image to transform
sourceImg - The (average) image of the source group
destImg - The (average) image of the destination group
shape - The amount to scale the shape transform by. 0 = no transform, 1= complete transform.
colour - The amount to scale the colour transform by. 0 = no transform, 1= complete transform.
texture - The amount to scale the texture transform by. 0 = no transform, 1= complete transform.
ob - An ImageObserver used for obtaining Image sizes
filters - the filters to use if doint a texture transform
fast - Flag indicating whether to use (fast?) linear warping with no sampling along the contours, or (slow?) multi-scale warping with full contour sampling.
bm - the border model of the wavelet analysis filters (1 symmetric, -1 anti-sym), if doing a texture transform
conts - flag indicating that contours should be sampled along (rather than just using template points)
Returns:
The transformed image.

transform

public static java.awt.Image transform(Template subjectTemplate,
                                       Template sourceTemplate,
                                       Template destTemplate,
                                       Template newTemplate,
                                       java.awt.Image subjectImg,
                                       java.awt.Image sourceImg,
                                       java.awt.Image destImg,
                                       double s,
                                       java.awt.image.ImageObserver ob,
                                       MaskInterface mask,
                                       boolean fast)
Transforms subjectImage using the prototypes given and returns the result. The transformed Template is returned in newTemplate. The transformation follows the formula: new = subject + s*(dest-source)

Parameters:
mask - The MaskInterface object defining the boundary of the masked region.
subjectTemplate - The Template outlining the features of subjectImg
sourceTemplate - The (average) Template outlining the features of sourceImg
destTemplate - The (average) Template outlining the features of destImg
newTemplate - Template to hold the Template corresponding to the transformed result. Useful for morphing afterwards.
subjectImg - The Image to transform
sourceImg - The (average) image of the source group
destImg - The (average) image of the destination group
s - The amount to scale this transform by. 0 = no transform, 1= complete transform.
ob - An ImageObserver used for obtaining Image sizes
fast - Flag indicating whether to use (fast?) linear warping with no sampling along the contours, or (slow?) multi-scale warping with full contour sampling.
Returns:
The transformed image.

testTransform

public static java.awt.image.BufferedImage testTransform(int warpType,
                                                         Template subTem,
                                                         Template srcTem,
                                                         Template dstTem,
                                                         Template outTem,
                                                         java.awt.Image subImg,
                                                         java.awt.Image srcImg,
                                                         java.awt.Image dstImg,
                                                         double shapeAmount,
                                                         double colourAmount,
                                                         double textureAmount,
                                                         Filter[] filters,
                                                         int bm,
                                                         MaskInterface mask,
                                                         boolean samples,
                                                         boolean borders,
                                                         boolean matchCols,
                                                         int normalisation,
                                                         int[] normPoints)
Face transform method, more modular version

Parameters:
warpType - the type of warp to use
subTem - the subject's Template
srcTem - the source group Template
dstTem - the target group Template
outTem - the output Template
subImg - the subject image
srcImg - the source group image
dstImg - the target group image
shapeAmount - the amount to transform the shape by
colourAmount - the amount to transform the colour by
textureAmount - the amount to transform the texture by
filters - the filters to use for texture transformation
bm - the border model (sym=1, anti-sym=-1) to use for the filters
mask - the mask to use (if any, or null)
samples - sample along template contours
borders - pin down the borders
matchCols - match the colours on the masked area
normalisation - indicates the kind of normalisation to use, one of ASM.RIGID_BODY_NORMALISATION, ASM.TWO_POINT_NORMALISATION, ASM.THREE_POINT_NORMALISATION or ASM.NO_NORMALISATION
normPoints - the normalisation points to use for ASM.TWO_POINT_NORMALISATION or ASM.THREE_POINT_NORMALISATION
Returns:
return the transformed image
See Also:
Warp.createWarp(int, int, int, int, int, boolean)

testTransform

public static java.awt.image.BufferedImage testTransform(int warpType,
                                                         Template subTem,
                                                         Template srcTem,
                                                         Template dstTem,
                                                         Template outTem,
                                                         java.awt.image.BufferedImage subImg,
                                                         java.awt.image.BufferedImage srcImg,
                                                         java.awt.image.BufferedImage dstImg,
                                                         double shapeAmount,
                                                         double colourAmount,
                                                         double textureAmount,
                                                         Filter[] filters,
                                                         int bm,
                                                         MaskInterface mask,
                                                         boolean samples,
                                                         boolean borders,
                                                         boolean matchCols,
                                                         int normalisation,
                                                         int[] normPoints)
Face transform method, more modular version

Parameters:
warpType - the type of warp to use
subTem - the subject's Template
srcTem - the source group Template
dstTem - the target group Template
outTem - the output Template
subImg - the subject image
srcImg - the source group image
dstImg - the target group image
shapeAmount - the amount to transform the shape by
colourAmount - the amount to transform the colour by
textureAmount - the amount to transform the texture by
filters - the filters to use for texture transformation
bm - the border model (sym=1, anti-sym=-1) to use for the filters
mask - the mask to use (if any, or null)
samples - sample along template contours
borders - pin down the borders
matchCols - match the colours on the masked area
normalisation - indicates the kind of normalisation to use, one of ASM.RIGID_BODY_NORMALISATION, ASM.TWO_POINT_NORMALISATION, ASM.THREE_POINT_NORMALISATION or ASM.NO_NORMALISATION
normPoints - the normalisation points to use for ASM.TWO_POINT_NORMALISATION or ASM.THREE_POINT_NORMALISATION
Returns:
return the transformed image
See Also:
Warp.createWarp(int, int, int, int, int, boolean)

caricatureChimeric

public static java.awt.image.BufferedImage caricatureChimeric(java.awt.image.BufferedImage subImg,
                                                              java.awt.image.BufferedImage cimg1,
                                                              java.awt.image.BufferedImage cimg2,
                                                              Template tmplt,
                                                              float l1,
                                                              float l2,
                                                              float wid)
Half face transform on the image (no warping)

Parameters:
subImg - the subject image
cimg1 - the source image
cimg2 - the target image
tmplt - the shape template
l1 - the amount to transform the left
l2 - the amount to transform the right
wid - the width of the smoothing band
Returns:
return the transformed image
See Also:
transformChimeric(int, Facemorph.Template, Facemorph.Template, Facemorph.Template, Facemorph.Template, java.awt.image.BufferedImage, java.awt.image.BufferedImage, java.awt.image.BufferedImage, float, float, float, boolean, boolean)

transformChimeric

public static java.awt.image.BufferedImage transformChimeric(int warpType,
                                                             Template subTem,
                                                             Template srcTem,
                                                             Template dstTem,
                                                             Template outTem,
                                                             java.awt.image.BufferedImage subImg,
                                                             java.awt.image.BufferedImage srcImg,
                                                             java.awt.image.BufferedImage dstImg,
                                                             float leftAmount,
                                                             float rightAmount,
                                                             float width,
                                                             boolean samples,
                                                             boolean borders)
Half face transform method

Parameters:
warpType - the type of warp to use
subTem - the subject Template
srcTem - the source group Template
dstTem - the target group Template
outTem - the output Template
subImg - the subject Image
srcImg - the source group image
dstImg - the target group image
leftAmount - the amount to transform the left side
rightAmount - the amount to transform the right side
width - the width of the smoothing band
samples - if true sample along Template contours
borders - add points to pin down the borders
Returns:
returns the transformed image
See Also:
Warp.createWarp(int, int, int, int, int, boolean)

mask

public static void mask(Template newTemplate,
                        MaskInterface mask,
                        java.awt.image.BufferedImage warped,
                        java.awt.image.BufferedImage transformed)
MaskInterface the colour changes to the array specified

Parameters:
newTemplate - the template that defines the mask
mask - the mask labels
warped - the warped image
transformed - the transformed image

normaliseColours

public static void normaliseColours(Template newTemplate,
                                    MaskInterface mask,
                                    java.awt.image.BufferedImage warped,
                                    java.awt.image.BufferedImage transformed)
Normalise the mean and standard deviation of colours in the masked area

Parameters:
newTemplate - the transformed template
mask - the mask labels
warped - the warped image
transformed - the transformed image

textureTransform

public static java.awt.image.BufferedImage textureTransform(java.awt.image.BufferedImage orig,
                                                            java.awt.image.BufferedImage sub,
                                                            java.awt.image.BufferedImage src,
                                                            java.awt.image.BufferedImage dst,
                                                            Filter[] filters,
                                                            int bm,
                                                            double amount)
Performs a texture (wavelet magnitude) transform on the image

Parameters:
orig - the warped original image
sub - the warped and colour transformed original image
src - the source group image
dst - the target group image
filters - the filters to use
bm - the border model to use
amount - the amount to transform the textures
Returns:
return the transformed image

warp

public static java.awt.image.BufferedImage warp(int warpType,
                                                java.awt.image.BufferedImage bimg,
                                                Template start,
                                                Template end,
                                                int outW,
                                                int outH,
                                                boolean samples,
                                                boolean borders)
Image warp method

Parameters:
warpType - the type of warp to use
bimg - the original image
start - the original Template
end - the target Template
outW - the output width
outH - the output height
samples - indicates if contours should be sampled
borders - indicates if the borders should be pinned down
Returns:
return the warped image

warp

public static FloatImage warp(int warpType,
                              FloatImage fimg,
                              Template start,
                              Template end,
                              int outW,
                              int outH,
                              boolean samples,
                              boolean borders)
Image warp method

Parameters:
warpType - the type of warp to use
bimg - the original image
start - the original Template
end - the target Template
outW - the output width
outH - the output height
samples - indicates if contours should be sampled
borders - indicates if the borders should be pinned down
Returns:
return the warped image

shiftColours

public static java.awt.image.BufferedImage shiftColours(java.awt.image.BufferedImage subImg,
                                                        java.awt.image.BufferedImage src,
                                                        java.awt.image.BufferedImage dst,
                                                        double amount)
Perform the colour shifting part of the transform

Parameters:
subImg - the warped original image
src - the warped source group image
dst - the warped target group image
amount - the amount to transform the colours by
Returns:
returns the colour transformed image

morph

public static java.util.Vector<java.awt.Image> morph(java.awt.Image img1,
                                                     Template tmp1,
                                                     java.awt.Image img2,
                                                     Template tmp2,
                                                     int steps,
                                                     java.awt.image.ImageObserver ob,
                                                     boolean fast)
Creates a Morph between two delineated images

Parameters:
img1 - The image to start from
tmp1 - The Template outlining the features of img1
img2 - The image to end at
tmp2 - The template outlining the features of img2
steps - The number of steps between the images i.e. the output list will contain steps+1 images
ob - AN ImageObserver, used for finding Image dimensions
fast - Flag to indicate if (fast?) linear warping with no contour sampling or (slow?) non-linear warping with full contour sampling.
Returns:
A Vector of Image objects representing the morph, includes the start and end points.

morph

public static java.util.Vector<java.awt.Image> morph(java.awt.Image img1,
                                                     Template tmp1,
                                                     java.awt.Image img2,
                                                     Template tmp2,
                                                     int steps,
                                                     java.awt.image.ImageObserver ob,
                                                     boolean fast,
                                                     java.util.Vector<Template> templates,
                                                     TransformerListener listener)
Creates a Morph between two delineated images

Parameters:
img1 - The image to start from
tmp1 - The Template outlining the features of img1
img2 - The image to end at
tmp2 - The template outlining the features of img2
steps - The number of steps between the images i.e. the output list will contain steps+1 images
ob - AN ImageObserver, used for finding Image dimensions
fast - Flag to indicate if (fast?) linear warping with no contour sampling or (slow?) non-linear warping with full contour sampling.
templates - Vector to hold output array of templates
listener - used for demonstrating output
Returns:
A Vector of Image objects representing the morph, includes the start and end points.

averageImages

public static java.awt.Image averageImages(java.awt.Image[] images,
                                           Template[] templates,
                                           Template averageTemplate,
                                           int outW,
                                           int outH,
                                           java.awt.image.ImageObserver obs,
                                           boolean autoSize,
                                           int normalisation)
Average a set of images

Parameters:
images - the images to average
templates - the templates specifying the location and shape of each face
averageTemplate - the average face shape
outW - the output width
outH - the output height
obs - an image observer
autoSize - flag indicating if the average should be auto resized to fit in the output image size
normalisation - the type of normalisation to use ASM.RIGID_BODY_NORMALISATION, ASM.TWO_POINT_NORMALISATION, ASM.NO_NORMALISATION
Returns:
returns the average image

averageImages

public static java.awt.Image averageImages(java.awt.Image[] images,
                                           Template[] templates,
                                           Template averageTemplate,
                                           int outW,
                                           int outH,
                                           java.awt.image.ImageObserver obs,
                                           boolean autoSize,
                                           int normalisation,
                                           TransformerListener warpListener,
                                           TransformerListener averageListener)
Method to create an average from a set of delineated images.

Parameters:
images - The array of images to be averaged.
templates - The array of templates outlining the features of the corresponding templates.
averageTemplate - The template in which the average shape description will be placed.
outW - The desired width of the output image.
outH - The desired height of the output image.
obs - An image observer used for getting the height and width of the image
normalisation - the type of normalisation to use ASM.RIGID_BODY_NORMALISATION, ASM.TWO_POINT_NORMALISATION, ASM.NO_NORMALISATION
autoSize - automatically resize the template to fill the output image
warpListener - used to display the process
averageListener - used to display the average emerging
Returns:
An int array of pixel values representing the average image.

averageImagesTexture

public static java.awt.Image averageImagesTexture(java.awt.Image[] images,
                                                  Template[] templates,
                                                  Template averageTemplate,
                                                  int outW,
                                                  int outH,
                                                  Filter[] filters,
                                                  int bm,
                                                  java.awt.image.ImageObserver obs,
                                                  boolean autoSize,
                                                  int normalisation)
Method to create an average from a set of delineated images.

Parameters:
images - The array of images to be averaged.
templates - The array of templates outlining the features of the corresponding templates.
averageTemplate - The template in which the average shape description will be placed.
outW - The desired width of the output image.
outH - The desired height of the output image.
filters - the filters to use
bm - the border model to use for the filters
obs - An image observer used for getting the height and width of the image
autoSize - indicates that the template should be expanded to fill the output image
normalisation - the type of normalisation to use ASM.RIGID_BODY_NORMALISATION, ASM.TWO_POINT_NORMALISATION, ASM.NO_NORMALISATION
Returns:
An int array of pixel values representing the average image.

averageImagesTexture

public static java.awt.Image averageImagesTexture(java.awt.Image[] images,
                                                  Template[] templates,
                                                  Template averageTemplate,
                                                  int outW,
                                                  int outH,
                                                  Filter[] filters,
                                                  int bm,
                                                  java.awt.image.ImageObserver obs,
                                                  boolean autoSize,
                                                  int normalisation,
                                                  TransformerListener warpListener,
                                                  TransformerListener averageListener)
Method to create an average from a set of delineated images.

Parameters:
images - The array of images to be averaged.
templates - The array of templates outlining the features of the corresponding templates.
averageTemplate - The template in which the average shape description will be placed.
outW - The desired width of the output image.
outH - The desired height of the output image.
filters - the filters to use
bm - the border model to use for the filters
obs - An image observer used for getting the height and width of the image
averageListener - used to display the averaging process
autoSize - resize the average template to fill the output image
normalisation - the type of normalisation to use ASM.RIGID_BODY_NORMALISATION, ASM.TWO_POINT_NORMALISATION, ASM.NO_NORMALISATION
warpListener - used to display the warping process
Returns:
An int array of pixel values representing the average image.

ImageToBufferedImage

public static java.awt.image.BufferedImage ImageToBufferedImage(java.awt.Image img,
                                                                java.awt.image.ImageObserver iob)
Converts an abstract (unknown type of) Image to a BufferedImage for extra functionality.

Parameters:
img - The image to convert
iob - An image observer (for getting the image size etc)
Returns:
The Image as a BufferedImage

transformBald

public static java.awt.Image transformBald(Template subjectTemplate,
                                           Template avTemplate,
                                           Template rotAvTemplate,
                                           Template baldAvTemplate,
                                           Template rotBaldAvTemplate,
                                           Template hairAvTemplate,
                                           Template rotHairAvTemplate,
                                           Template newTemplate,
                                           java.awt.Image subjectImg,
                                           java.awt.Image sourceImg,
                                           java.awt.Image destImg,
                                           double s,
                                           java.awt.image.ImageObserver ob,
                                           boolean colour,
                                           boolean fast)
Transforms subjectImage using the prototypes given and returns the result. The transformed Template is returned in newTemplate. The transformation follows the formula: new = subject + s*(dest-source)

Parameters:
avTemplate - The average template
rotAvTemplate - The rotated average template
baldAvTemplate - the face-on bald average template
rotBaldAvTemplate - the rotated bald average template
hairAvTemplate - the face-on with hair average template
rotHairAvTemplate - the rotated with-hair average template
newTemplate - The output template, delineatng the transformed image, useful for further processing.
colour - Flag indicating if to change the colours, false implies just the shape is changed
subjectTemplate - The Template outlining the features of subjectImg
subjectImg - The Image to transform
sourceImg - The (average) image of the source group
destImg - The (average) image of the destination group
s - The amount to scale this transform by. 0 = no transform, 1= complete transform.
ob - An ImageObserver used for obtaining Image sizes
fast - Flag indicating whether to use (fast?) linear warping with no sampling along the contours, or (slow?) multi-scale warping with full contour sampling.
Returns:
The transformed image.