• Ingen resultater fundet

AOF – AAM Optimization File

In document ACTIVE APPEARANCE MODELS (Sider 125-0)

0 1 0.449038 0.482457 25 24 26 0 1 0.442961 0.465572 26 25 27 0 1 0.441553 0.444790 27 26 28 0 1 0.441644 0.425711 28 27 29 0 1 0.446147 0.410962 29 28 30 0 1 0.457776 0.391605 30 29 31 0 1 0.477158 0.377265 31 30 32 0 1 0.498719 0.375223 32 31 0 1 0 0.527584 0.347407 33 65 34 1 0 0.540823 0.350820 34 33 35 1 0 0.554225 0.355885 35 34 36 1 0 0.571020 0.365448 36 35 37 1 0 0.584007 0.374006 37 36 38 1 0 0.597431 0.383626 38 37 39 1 0 0.609678 0.395252 39 38 40 1 0 0.621089 0.409628 40 39 41 1 0 0.626961 0.422494 41 40 42 1 0 0.628915 0.437005 42 41 43 1 0 0.628104 0.450329 43 42 44 1 0 0.623325 0.466479 44 43 45 1 0 0.615272 0.479872 45 44 46 1 0 0.604699 0.492765 46 45 47 1 0 0.589989 0.507293 47 46 48 1 0 0.576942 0.517555 48 47 49 1 0 0.563292 0.526087 49 48 50 1 0 0.544622 0.534137 50 49 51 1 0 0.528754 0.537687 51 50 52 1 0 0.521873 0.539179 52 51 53 1 0 0.519447 0.538970 53 52 54 1 0 0.513286 0.538763 54 53 55 1 0 0.489473 0.534848 55 54 56 1 0 0.469023 0.528177 56 55 57 1 0 0.450248 0.513003 57 56 58 1 0 0.433815 0.493809 58 57 59 1 0 0.424770 0.473959 59 58 60 1 0 0.422778 0.446886 60 59 61 1 0 0.422572 0.419639 61 60 62 1 0 0.428038 0.399094 62 61 63 1 0 0.449634 0.384622 63 62 64 1 0 0.469204 0.359666 64 63 65 1 0 0.496774 0.347135 65 64 33

E.4 AOF – AAM Optimization File

#####################################################################

#

250 Appendix E. AAM-API File Format Examples

# Active Appearance Model Optimization File

#

# Best viewed with tabsize==4

#

10 5 # size search; format "deviation steps"

# hence "10 5" would search the image using

# the following sizes 90% 95%, 100%, 105%, 110%

.1 3 # rotation search; format "deviation steps"

# hence "10 5" would search the image using

# the following rotations of the mean shape

# -0.1pi, 0, 0.1pi

##########################

# model search parameters

##########################

3 7 # pc1-parameter search; format "deviation steps"

# hence "3 7" will derform the model using

# pc1 = -3, -2, -1, 0, 1, 2, 3 (std.dev.)

251

Appendix F

AAM-API Console Interface Usage

AAMC - Active Appearance Model Console Interface - version 0.8.32

Copyright (c) Mikkel B. Stegmann 2000 - aam@imm.dtu.dk. All rights reserved.

For further information see http://www.imm.dtu.dk/~aam/

USAGE:

aamc <b|c|e|m|r|s|t|w|sm|d> [additional mode arguments]

MODES:

aamc b <input dir> <extension> <out model> [acf file]

aamc c <input image> <output image> [reduction factor]

aamc e <model> <dir> <ext> [still|movie|both|none*] [pseudo|auto*]

[sm] [ft]

aamc m <model.amf> <type: all|shape|texture|combined> [#modes] [#frames]

aamc r <model.amf> <input dir> <extension>

aamc s <input model.amf> <input image> [movie filename]

aamc t <model.amf> <input movie>

aamc w <input image> <reduction factor>

aamc sm <input movie> [output extension]

aamc d

For futher help write: ’aam -help’, ’aam -full’ or ’aam <modename> -help’

The tool ’aamc’ is the console interface to the AAM-API.

---MODE: b - Builds an Active Appearance Model.

252 Appendix F. AAM-API Console Interface Usage

---USAGE:

aamc b <input dir> <extension> <out model> [acf file]

DESCRIPTION:

Builds an Active Appearance Model.

In this mode the principal component analysis, parameter optimization training etc. are done.

input dir : Directory containing images and annotations.

extension : Image extension used. Ex. ’bmp’, ’hips’ etc.

out model : Filename (and path) of the output model file. Ex. ’model42’.

acf file : AAM configuration file.

---MODE: c - Image conversion with optional reduction.

---USAGE:

aamc c <input image> <output image> [reduction factor]

DESCRIPTION:

Image conversion with optional reduction.

Example usage:

aamc c meta.tif meta.bmp

---MODE: e - Evaluates an Active Appearance Model.

---USAGE:

aamc e <model> <dir> <ext> [still|movie|both|none*] [pseudo|auto*]

[sm] [ft]

DESCRIPTION:

Evaluates an Active Appearance Model.

model : The model .amf that should be evaluated.

dir : Directory containing images and ground truth annotations.

ext : Image extension used. Ex. ’bmp’, ’hips’ etc.

253

[still|movie|both] : Write stills of the initial and optimized model and/or movies of the complete optimization.

[pseudo|auto*] : Initialization method.

[sm] : Similarity measure used in the optimization:

0 = Non-normalized L_2 norm*

1 = The Mahalanobis distance 2 = The Lorentzian error norm [ft] : Fine tuning of the optimization:

0 = None*

Output is written in the input dir in the file ’results.txt’

Default settings are marked with an asterisk (*)

---MODE: m - Writes Active Appearance Model movies.

---USAGE:

aamc m <model.amf> <type: all|shape|texture|combined> [#modes] [#frames]

DESCRIPTION:

Writes Active Appearance Model movies.

This mode documents the given AAM by generating movies showing the shape, texture and combined variation resulting from the PCA.

Output is written in current dir.

---MODE: r - Tests the regression prediction in an AAM.

---USAGE:

aamc r <model.amf> <input dir> <extension>

DESCRIPTION:

Tests the regression prediction in an AAM.

Output is written in the input dir in matlab format.

254 Appendix F. AAM-API Console Interface Usage

---MODE: s - Active Appearance Model search.

---USAGE:

aamc s <input model.amf> <input image> [movie filename]

DESCRIPTION:

Active Appearance Model search.

Search output is written in the input dir.

Automatic initialization is performed.

---MODE: t - Performs tracking in a movie file (.avi).

---USAGE:

aamc t <model.amf> <input movie>

DESCRIPTION:

Performs tracking in a movie file (.avi).

This mode performs a through initialization of the AAM in the first frame and uses the convergence position as initial pose in the next frame (and so on...).

Example usage:

aamc t hand.avi

---MODE: w - Plots an annotation into a given image.

---USAGE:

aamc w <input image> <reduction factor>

DESCRIPTION:

Plots an annotation into a given image.

Image input format : .bmp .hips Annotation input format : .m

255

An annotation file is expected to be placed in the same directory as the image.

E.g.: ’c:\scan42.bmp’ and ’c:\scan42.m’

---MODE: sm - Split movie file (.avi) into frames.

---USAGE:

aamc sm <input movie> [output extension]

DESCRIPTION:

Split movie file (.avi) into frames.

Example usage:

aamc sm shape01.avi bmp

---MODE: d - Debug/Test console mode. Don’t use!

---USAGE:

aamc d DESCRIPTION:

Debug/Test console mode. Don’t use!

256 Appendix F. AAM-API Console Interface Usage

257

Appendix G

ASF – AAM Shape Format Specification

Since the extended shape representation constitutes one of the contribu-tions a thorough description of it is features is given below.

An ASF file is structured as a set of lines separated by a CR character.

Anywhere in the file, comments can be added by starting a line with the percentage character. Line 1 contains the total number of points,n, in the shape. Line 1 to n+1 contains the point information (one line per point) such as the point location, type, connectivity. The format philosophy is that quick and simple access is preferred over data compactness (thus:

data redundancy is allowed).

The precise format of a point definition is:

point := ¡path#¿ ¡type¿ ¡rel. point x¿ ¡rel. point y¿ ¡point#¿

¡connects from¿ ¡connects to¿

Each field is seperated by space(s) or tab(s).

¡path#¿ The path that the point belongs to. Point from different paths must not be interchanged (in the line order).

¡type¿ A bitmapped field that defines the type of point:

Bit 1: Outer edge point/Inside point

258 Appendix G. ASF – AAM Shape Format Specification

Bit 2: Original annotated point/Artificial point

Bit 3: Closed path point/Open path point

Bit 4: Non-hole/Hole point

Remaining bits should be set to zero. An inside artificial point which is a part of an closed hole, has thus the type: (1 << 1) + (1 <<

2) + (1<<4) = 1 + 2 + 4 = 7.

¡rel. point x¿ The relative x-position of the point – i.e. pixel x = 47 in a 256 pixel wide image has the position 47/256 = 0.18359375.

¡rel. point y¿ The relative y-position of the point – i.e. pixel y = 47 in a 256 pixel tall image has the position 47/256 = 0.18359375.

¡point#¿ The point number. First point is zero. This is merely a service to the human reader since the real point number is implicitly given by the line at where the point occurs.

¡connects from¿ The previous point on this path. If none ¡connects from¿ == ¡point#¿ can be used.

¡connects to¿ The next point on this path. If none ¡connects from¿ ==

¡point#¿ can be used.

Path points are assumed to be defined clockwise. That is; the outside normal is defined to be on left of the point in the clockwise direction. Hole is thus defined counter-clockwise.

Points are defined in the fourth quadrant – i.e. row, column notation (0,0)

= upper left corner.

Isolated points are signaled using ¡connects from¿ == ¡connects to¿ ==

¡point#¿.

A shape must have at least one outer edge. If the outer edge is open, the convex hull is used to determine the interior of the shape.

Refer to appendix E for an example ASF file.

In document ACTIVE APPEARANCE MODELS (Sider 125-0)