Back AAM-API documentation The AAM-Site

In file AAMReferenceFrame.h:

class CAAMReferenceFrame

The geometrical reference frame (or shape-free frame).

Inheritance:

CAAMReferenceFrame


Public Methods

[more] CAAMReferenceFrame( const CAAMReferenceFrame &rf )
Copy constructor.
[more] CAAMReferenceFrame()
Constructor.
[more]void CalcMaskImage( const bool useConvexHull )
Calculates a reference mask image.
[more]void CalcScanLines()
Calculates the scanlines of the mask image.
[more]void DebugDump()
Writes some of the class data to disk.
[more]bool FindTriangle( const CAAMPoint &p, unsigned short &triangle, double &alpha, double &beta, double &gamma ) const
Find the corresponding triangle in the source mesh for a point.
[more]void FromFile( FILE* fh )
Reads the class data form disk.
[more]void Image2Vector( const CDMultiBand<TAAMPixel> &refImg, CDVector &v ) const
Conversion from shape-free image to a texture vector.
[more]const CDMultiBand<TAAMPixel> & MaskImage() const
Returns the mask image
[more]int NTextureSamples() const
Returns the number of texture samples in the texture model
[more]int RefImageHeight() const
Returns the height of the reference image.
[more]int RefImageWidth() const
Returns the width of the reference image.
[more]const CAAMMesh& RefMesh() const
Returns the reference mesh
[more]const CAAMShape& RefShape() const
Returns the reference shape
[more]double RefShapeHeight() const
Returns the height of the reference shape.
[more]double RefShapeWidth() const
Returns the width of the reference shape.
[more]void Setup( const CAAMShape &referenceShape, const bool useConvexHull )
Sets up the class with the reference shape.
[more]void ToFile( FILE* fh ) const
Writes the class data to disk.
[more]bool UseConvexHull() const
Returns true of the convex hull determines the shape extent
[more]void Vector2Image( const CDVector &v, CDMultiBand<TAAMPixel> &outImg ) const
Conversion from a texture vector to a shape-free image.
[more]void Vector2Matrix( const CDVector &v, CDMatrix &m ) const
Conversion from a texture vector to a shape-free matrix.
[more]CAAMReferenceFrame& operator=(const CAAMReferenceFrame &rf)
Assignment operator.
[more] ~CAAMReferenceFrame()
Destructor.


Documentation

This class defined the geomtrical reference frame of an AAM. Hence, it is the spatial layout where all texture sampling takes place.

The main objective of this class is to provide fast conversions from a shape-free image to a texture vector and vice versa.

obool UseConvexHull() const
Returns true of the convex hull determines the shape extent

oconst CAAMShape& RefShape() const
Returns the reference shape

oint NTextureSamples() const
Returns the number of texture samples in the texture model

oconst CAAMMesh& RefMesh() const
Returns the reference mesh

oconst CDMultiBand<TAAMPixel> & MaskImage() const
Returns the mask image

o CAAMReferenceFrame()

Constructor. Sets up an empty reference frame. Use Setup() to make such an object any useful.

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

oCAAMReferenceFrame& operator=(const CAAMReferenceFrame &rf)

Assignment operator.

Parameters:
rf - Object to copy from.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
6-13-2002

o CAAMReferenceFrame( const CAAMReferenceFrame &rf )

Copy constructor.

Parameters:
rf - Reference frame object to be copied by construction.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
6-13-2002

ovoid Setup( const CAAMShape &referenceShape, const bool useConvexHull )

Sets up the class with the reference shape and information about how to determine the extent of the shape.

Parameters:
referenceShape - The reference shape.
useConvexHull - If true the convex hull of the reference shape is used to determine its extent.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
6-7-2002

ovoid ToFile( FILE* fh ) const

This method writes the class data to disk. Actually it is only the reference shape and the convex hull option that is written. The rest is reconstructed during read.

Parameters:
fh - Open file handle to a binary file.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
6-13-2002

ovoid FromFile( FILE* fh )

This method reads the class data from disk. Actually it is only the reference shape and the convex hull option that is read. The rest is reconstructed.

Parameters:
fh - Open file handle to a binary file.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
6-13-2002

ovoid DebugDump()

This method writes the reference shape, the mask image and a test of the Image2Vector() and Vector2image() to the current directory.

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

o ~CAAMReferenceFrame()

Destructor. Deletes any reference shape, mesh and mask image.

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

ovoid CalcMaskImage( const bool useConvexHull )

This method calculates a reference mask image, where the shape area is set to 255 and the background to zero. The resulting image is stored in 'm_pMaskImage'.

Parameters:
useConvexHull - If true the convex hull is used to define the extent of the reference shape.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
6-7-2002

ovoid CalcScanLines()

This method calculates the scanlines of the mask image. A scanline is a subpart of a horsontal image line that is occupied but a subpart of the reference shape.

The resulting scanlines are used for quick'n'easy conversion from spatial to vector layout (and back).

Scanlines are stored in 'm_ScanlineParts'.

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

odouble RefShapeWidth() const

Returns the width of the reference shape.

Returns:
The width.
Author:
Mikkel B. Stegmann
Version:
6-7-2002

odouble RefShapeHeight() const

Returns the height of the reference shape.

Returns:
The height.
Author:
Mikkel B. Stegmann
Version:
6-7-2002

ovoid Image2Vector( const CDMultiBand<TAAMPixel> &refImg, CDVector &v ) const

This method performs a quick conversion from a shape-free image to a texture vector.

Parameters:
refImg - Destination reference image.
v - Input texture vector.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
6-7-2002
See Also:
Vector2Image

ovoid Vector2Image( const CDVector &v, CDMultiBand<TAAMPixel> &outImg ) const

This method performs a quick conversion from a texture vector to a shape-free image.

Parameters:
refImg - Destination reference image.
v - Input texture vector.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
6-7-2002
See Also:
Vector2Matrix, Image2Vector

ovoid Vector2Matrix( const CDVector &v, CDMatrix &m ) const

This method performs a quick conversion from a texture vector to a shape-free image on matrix form.

Will currently only work on single band AAMs.

Parameters:
refImg - Destination reference image.
v - Input texture vector.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
6-7-2002
See Also:
Vector2Matrix, Image2Vector

oint RefImageWidth() const

Returns the width of the reference image.

Returns:
The width.
Author:
Mikkel B. Stegmann
Version:
6-7-2002

oint RefImageHeight() const

Returns the height of the reference image.

Returns:
The height.
Author:
Mikkel B. Stegmann
Version:
6-7-2002

obool FindTriangle( const CAAMPoint &p, unsigned short &triangle, double &alpha, double &beta, double &gamma ) const

Find the corresponding triangle in the source mesh for a point.

Parameters:
p - Input point
triangle - Triangle index.
alpha - Relative position on triangle (barycentric coordinate).
beta - Relative position on triangle (barycentric coordinate).
gamma - Relative position on triangle (barycentric coordinate).
Returns:
True if the point is inside the source mesh.
Author:
Mikkel B. Stegmann
Version:
6-7-2002


This class has no child classes.
Author:
Mikkel B. Stegmann
Version:
6-7-2002

Alphabetic index Hierarchy of classes


Back AAM-API documentation The AAM-Site