Back AAM-API documentation The AAM-Site

In file AAMModelMS.h:

class CAAMModelMS

Multi-scale derivation of CAAModel.

Inheritance:

CAAMModelMS - CAAMModel - CAAMObject


Public Methods

[more]void BuildAllLevels( const int nLevels, const std::vector<CString> &asfFiles, const CString &acf, const int modelReduction, const int excludeShape )
Diver method for model generation.
[more]void BuildAllLevels( const int nLevels, const CString &inDir, const CString &acf, const int modelReduction, const int excludeShape )
Diver method for model generation.
[more]void BuildPyr( const CDMultiBand<TAAMPixel> &image ) const
Builds an image pyramid (if its not cached beforehand).
[more] CAAMModelMS()
Default multi-scale constructor.
[more]inline const CAAMModel& Model( const int i ) const
Get the model at level i
[more]inline const int NLevels() const
Get the number of levels
[more]CAAMModel::CAAMOptRes OptimizeModel( const CDMultiBand<TAAMPixel> &image, CAAMShape &s, CDVector &c, const int maxIterations, std::vector<CAAMOptState>* pOptStates, bool disableDamping ) const
Performs AAM optimization of a shape (using a model pyramid).
[more]bool ReadModel( const CString &basename )
Reads the complete AAMModel from disk.
[more]bool WriteModel( const CString &filename, const bool txt_only ) const
Writes the complete multi-scale AAMModel to disk as a set of .txt and an .amf files.
[more] ~CAAMModelMS()
multi-scale destructor.


Inherited from CAAMModel:

Public Methods

oinline double AddExtents() const
obool ApproxExample( const CString &filename, CDMultiBand<TAAMPixel> &outImg ) const
ovoid Combined2ShapeParam( const CDVector &c, CDVector &b_s ) const
ovoid Combined2TexParam( const CDVector &c, CDVector &b_g ) const
oinline const CAAMDeformPCA& CombinedPCA() const
ovoid ConstrainSearchParameters( CDVector &c, CDVector &pose ) const
obool EstimatePose( const CDMultiBand<TAAMPixel> image, const CAAMShape &shape, CDVector &pose ) const
oinline bool IsConvexHullUsed() const
oinline const CAAMShape& MeanShape() const
oinline double MeanShapeSize() const
oinline const CDVector& MeanTexture() const
odouble ModelEstimateTexDiff( const CDMultiBand<TAAMPixel> &image, const CDVector &c, CAAMShape &estimate, CDVector &diff, const int similaritym, const bool useInterpolation ) const
ovoid ModelImage( const CDVector &c, CDMultiBand<TAAMPixel> &outImg, const CAAMShape* matchPose, const bool fitTexture ) const
ovoid ModelImageEx( const CAAMShape &shape, const CDVector &texture, CDMultiBand<TAAMPixel> &outImg, const bool renderImage, const bool fitTexture ) const
oinline int NBands() const
oint NTextureSamples() const
ovoid NormalizeTexture(CDVector &texture) const
oCAAMModel::CAAMOptRes OptimizeModelByFineTuning( const CDMultiBand<TAAMPixel> &image, CAAMShape &s, CDVector &c, const int maxIterations, const int similaritym, const int optimizer ) const
oconst CDMatrix& Qg() const
oconst CDMatrix& Qs() const
oconst CDMatrix& Rc() const
oinline int ReductionFactor() const
oconst CAAMReferenceFrame& ReferenceFrame() const
oconst CAAMShape& ReferenceShape() const
oconst CDMatrix& Rt() const
oint SampleShape( const CDMultiBand<TAAMPixel> &image, const CAAMShape &shape, CDVector &textureSamples, const bool normalize, const bool useInterpolation, const bool map ) const
ovoid SetPoseParameterUpdateConstraints( const CDVector &pc )
ovoid SetShapeParameterUpdateConstraints( const CDVector &mean, const CDVector &sd )
ovoid Shape2Combined( const CAAMShape &shape, const CDMultiBand<TAAMPixel> &image, CDVector &c ) const
ovoid Shape2Param( const CAAMShape &shape, CDVector &b_s ) const
ovoid ShapeFreeImage( const CDVector &textureSamples, CDMultiBand<TAAMPixel> &outImg, const bool deMap ) const
ovoid ShapeFreeImage( const CDVector &textureSamples, CDMatrix &m, const bool deMap, const bool normalize ) const
ovoid ShapeInstance( const CDVector &c, CAAMShape &outShape ) const
oinline const CAAMDeformPCA& ShapePCA() const
ovoid ShapePCAInstance( const CDVector &b_s, CAAMShape &outShape ) const
ovoid ShapeTex2Combined( const CAAMShape &shape, const CDVector &texture, CDVector &c ) const
ovoid ShapeTex2Param( const CAAMShape &shape, const CDVector &texture, CDVector &b ) const
ovoid ShapeTexParam2Combined( const CDVector &b_s, const CDVector &b_g, CDVector &c ) const
ovoid ShapeTexParam2Combined( const std::vector<CDVector> &bVectors, std::vector<CDVector> &cVectors ) const
ovoid ShapeTexParam2Combined( const CDVector &b, CDVector &c ) const
ovoid TextureInstance( const CDVector &c, CDVector &outTexture ) const
oinline const CAAMDeformPCA& TexturePCA() const
ovoid WriteVarianceMap( const CString &filename ) const
oCAAMModel& operator=(const CAAMModel &m)

Public Members

class CAAMOptRes
Stores optimization results.
ostruct CAAMOptState

Protected Fields

oCAAMDeformPCA m_CombinedPCA
oCDMatrix m_R_c
oCAAMDeformPCA m_ShapePCA
oCAAMDeformPCA m_TexturePCA
odouble m_dAMFVersion
oint m_iTextureSamples
oCDMatrix m_mQgEV
oCDMatrix m_mQsEV
oCDMatrix m_mShape2PixelWeights
oCDMatrix m_mShapeInstance
oCDMatrix m_mTextureInstance
oCAAMTransferFunction* m_pTextureTF
oCAAMShape m_sMeanAShape
oCDVector m_vMeanTexture
oCDVector m_vTextureVar


Inherited from CAAMObject:

Public Methods

ovoid Dump( const char* szPath ) const
ovoid FromFile( const char* szFilename )
ovoid FromFile( FILE* fh )
ovoid ToFile( FILE* fh ) const
ovoid ToFile( const char* szFilename ) const


Documentation

Multi-scale derivation of CAAModel. Smaller models are stored in m_vModels.

oinline const CAAMModel& Model( const int i ) const
Get the model at level i

oinline const int NLevels() const
Get the number of levels

o CAAMModelMS()

Default multi-scale constructor.

Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
12-6-2002

o ~CAAMModelMS()

multi-scale destructor.

Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
12-6-2002

ovoid BuildAllLevels( const int nLevels, const CString &inDir, const CString &acf, const int modelReduction, const int excludeShape )

This method automates the model generation as much as possible by using the various class methods for all the sequences in the task of producing a model.

Parameters:
nLevels - The number of levels the multi-scale AAM should be in. Default 3.
inDir - Input directory where annotations (.asf) resides.
acf - Filename of an AAM configuration file. If omitted defaults are used.
modelReduction - Model reduction multiplier. Default off == 1. This sets the size of the lowest level in the model pyramid, i.e. level 0.
excludeShape - Excludes one shape number 'excludeShape' from the input directory. Default -1, i.e. no shapes are removed. Used to perform leave-one-out testing.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
4-14-2000

ovoid BuildAllLevels( const int nLevels, const std::vector<CString> &asfFiles, const CString &acf, const int modelReduction, const int excludeShape )

This method automates the model generation as much as possible by using the various class methods for all the sequences in the task of producing a model.

Parameters:
nLevels - The number of levels the multi-scale AAM should be in. Default 3.
asfFiles - Vector of asf filenames.
acf - Filename of an AAM configuration file. If omitted defaults are used.
modelReduction - Model reduction multiplier. Default off == 1. This sets the size of the lowest level in the model pyramid, i.e. level 0.
excludeShape - Excludes one shape number 'excludeShape' from the input directory. Default -1, i.e. no shapes are removed. Used to perform leave-one-out testing.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
12-6-2002

obool WriteModel( const CString &filename, const bool txt_only ) const

Writes the complete multi-scale AAMModel to disk as a set of .txt and an .amf files.

Parameters:
filename - Output filename without any extension. Multi-scale prefixes will be added.
txt_only - If true binary model data is not written.
Returns:
true on success, false on file errors.
Author:
Mikkel B. Stegmann
Version:
12-6-2002
See Also:
ReadModel

obool ReadModel( const CString &basename )

Reads the complete AAMModel from disk.

Parameters:
filename - Input filename without any extension and scale prefixes. E.g. if the files on disk are 'model_msl<level>.txt' & 'model_msl<level>.amf' -> filename = 'model'
Returns:
true on success, false on file errors.
Author:
Mikkel B. Stegmann
Version:
12-6-2002
See Also:
WriteModel

oCAAMModel::CAAMOptRes OptimizeModel( const CDMultiBand<TAAMPixel> &image, CAAMShape &s, CDVector &c, const int maxIterations, std::vector<CAAMOptState>* pOptStates, bool disableDamping ) const

Performs AAM optimization of a shape containing initial pose using a model pyramid.

Parameters:
image - The image to search in (in size corresponding to level zero).
s - The initial shape (also containing the inital pose, thus; not a normalized shape). Actually only the pose of 's' is used (to align the reference shape as the initial shape). NOTE: The optimal shape is returned in 's' after execution. NOTE: 's' is defined at level 0, i.e. shapes should have the same size as when calling CAAMModel::OptimizeModel() directly.
c - The optimal model parameters at level zero. Unlike CAAMModel::OptimizeModel() the content of this vector is not used, since the optimisation is started the smallest (i.e. top) level of the pyramid. NOTE: The optimal model parameters are returned in 'c' after execution.
maxIterations - The maximum iterations allowed at each level.
pOptStates - Optional parameter convergence info (at level zero) can be returned in. See CAAMOptState.
disableDamping - Disables the damping steps (default false).
Returns:
The results of the optimization in the form of a 'CAAMOptRes' instance.
Author:
Mikkel B. Stegmann
Version:
12-6-2002

ovoid BuildPyr( const CDMultiBand<TAAMPixel> &image ) const

Builds an image pyramid (if its not cached beforehand). The pyramid is stored in m_VImagePyr.

Parameters:
image - Input image that should be convertet to a pyramid. This image is assumed to live to the *complete* usage of the pyramid, since level 0 is a pointer to this image.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
12-6-2002


This class has no child classes.
Author:
Mikkel B. Stegmann
Version:
12-6-2002
See Also:
CAAMModel

Alphabetic index Hierarchy of classes


Back AAM-API documentation The AAM-Site