Building an Appearance Model

To build an appearance model you need You then need the build_apm tool.
At the command line invoke
am_build_apm xxxx
where xxxx.smd is the base name of your SMD file.
This will create a file modelname.apm in the directory specified in the SMD file.

Modelling regions

Optionally one can specify the regions to be modelled in the texture model by defining a triangles file. The build_apm will check for the existance of a file called model_path.tri, and if it exists, assume it defines the triangles to be represented. If no such file can be loaded, then it will model everything within the convex hull of the points. Note that a triangles file may also be explicitly invoked within the SMD file (see the "tri_file:" option).
You can generate and edit triangulation files using the am_tri_editor tool.

Parameters defining the Appearance Model

The Appearance Model is defined by the parameters specified in the SMD file.
If is formed from three components

Parameters defining the Shape Model

See building shape models.

A multi-resolution model will be built, with levels defined by the following fields:

min_level: 0
max_level: 2

Parameters defining the Texture Model

The texture model consists of

Texture Sampling

The tex_sampler command defines how the image is to be sampled. There are two general approaches:

For Region (Triangulated) Models
tex_sampler: vapm_triangle_sampler<vxl_byte>
For Profile Models

tex_sampler: vapm_profile_set_sampler
  profile_sampler: vsml_profile_sampler_2d<vxl_byte>
  prof_hi: 2
  prof_lo: -2
  width: 1
  step_size: 1.0
  use_gradient: 0
  use_sigmoidal_renormalisation: 0

The following properties can be specified to all of the samplers

The following options also affect the sampling

The number of pixels sampled is given by the n_pixels: field:

n_pixels: 5000
The larger this number, the higher the resolution of the model. Note that this defines the resolution of the level zero model, higher level models will have reduced numbers of pixels (typically half the number in each dimension). Whether grey level or colour (RGB) models are to be built is defined by the colour: field:
colour: Grey     // Alternatives: Grey,RGB


The normalisation method is defined by the tex_aligner: field (so named because of the equivalence between aligning shapes together and aligning textures as 1D shapes).
// Options include None, align_linear_1d, align_linear_rgb, align_cog_rgb
tex_aligner: AlignLinear1D

Statistical Model for Texture

The statistical model for texture is defined by the tex_model: field:
// Define statistical model for texture.
tex_model: pca
Options include `pca' for a linear eigen model, or `pca+haar1d' for a method which applies 1D Haar wavelets to compress the data before applying PCA.

Model Parameters

The number of modes of the texture model is defined by the tex_modes: field.
tex_modes:  { min: 0 max: 999 prop: 0.95 }
The number will be chosen to explain proportion of the variance, constrained by min and max. Similarly the number of modes of the combined model is defined by the combined_modes: field:
combined_modes:  { min: 0 max: 999 prop: 0.95 }

Viewing the Model

You can view the model using the am_view_apm tool.
You can view the shape model alone using the am_view_shape_model tool.