CAAMShape m_MeanShapeBeforeTS
- The meanshape prior to tangent space projection (calculated during alignment)
double m_dAvgSize
- The average shape size (calculated during alignment)
CString m_szPath
- Path to the asf files (if any)
inline int NShapes() const
- The number of shapes in the collection
inline int NPoints() const
- The number of points in each of shape
double MeanSize() const
- Returns the average shape size *before* the aligment process
const CString& Path() const
- Returns the path of all shapes
Assignment operator
- Assignment operator
CAAMShapeCollection()
-
Constructor.
- Author:
- Mikkel B. Stegmann
- Version:
- 7-27-2000
~CAAMShapeCollection()
-
Destructor.
- Author:
- Mikkel B. Stegmann
- Version:
- 7-27-2000
void Insert(const CAAMShape &s)
-
- Parameters:
- s - The input shape.
- Author:
- Mikkel B. Stegmann
- Version:
- 7-27-2000
int ToMatlab(const CString& sFilename, const CString& sName, const CString& sComment, bool fAppend) const
-
Writes the shapes in a (NShapes x 2*NPoints) matrix in Matlab
(*.m) format.
The i-th row thus contains the i-th shape in xxxyy format.
- Parameters:
- sFilename - Filename including path to be written.
sName - The matlab variable name of the matrix.
sComment - An optional comment.
fAppend - Addend to an existing file or overwrite.
- Returns:
- Zero on sucess, non-zero if no shapes are stored in the
collection.
- Author:
- Mikkel B. Stegmann
- Version:
- 02-09-2000
int AlignShapes( bool use_tangentspace )
-
Normalizes all shapes with respect to position, scale
and orientation.
Position normalization are done by a translation of the
center of gravity to origo.
Scale normalization are done by a scaling of 1/<norm2>.
Rotation normalization are done by minimizing the sum of
squared point distances, as described by Goodall using
Singular Value Decomposition (SVD).
- Returns:
- Zero on succes.
- Author:
- Mikkel B. Stegmann
- Version:
- 02-09-2000
void MeanShape(CAAMShape &meanShape) const
-
Calcs the mean shape of all shapes.
- Parameters:
- meanShape - The output mean shape.
- Author:
- Mikkel B. Stegmann
- Version:
- 7-27-2000
- See Also:
void ReferenceShape(CAAMShape &refShape) const
-
Calcs the mean shape of all aligned shapes and size it to mean size.
- Parameters:
- refShape - The output reference shape.
- Author:
- Mikkel B. Stegmann
- Version:
- 7-27-2000
- See Also:
double MinX() const
-
- Returns:
- The x-minimum.
- Author:
- Mikkel B. Stegmann
- Version:
- 5-15-2000
double MaxX() const
-
- Returns:
- The x-maximum.
- Author:
- Mikkel B. Stegmann
- Version:
- 5-15-2000
double MinY() const
-
- Returns:
- The x-minimum.
- Author:
- Mikkel B. Stegmann
- Version:
- 5-15-2000
double MaxY() const
-
- Returns:
- The y-maximum.
- Author:
- Mikkel B. Stegmann
- Version:
- 5-15-2000
void Scale( const double s, const bool aroundCOG )
-
Scale the shapes.
- Parameters:
- s - Scale factor.
aroundCOG - If true the scale is being done around the
cog of the shape instead of around the global
center.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 3-15-2000
void Expand( int nPixels )
-
Expands all shapes by moving each model point 'nPixels' perperdicular
to the shape contour (that is: along the model point normal).
This function will expand each outer (closed) path of the shape.
No tests for crossing contours are being made as of now.
- Parameters:
- nPixels - The number of pixel to expand the shape with.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 4-4-2000
void ToFile(const CString& sFilename) const
-
Write the set of shapes to a binary file.
- Parameters:
- sFilename - Destination filename.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 5-4-2000
- See Also:
- FromFile
void FromFile(const CString& sFilename)
-
- Parameters:
- sFilename - The filename.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 3-15-2000
void ToFile( FILE* fh ) const
-
Write the set of shapes to a binary file.
- Parameters:
- fh - Destination file handle.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 5-4-2000
- See Also:
- FromFile
void FromFile( FILE* fh )
-
- Parameters:
- fh - An open file handle.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 3-15-2000
bool ReadShapes( const std::vector<CString> &asfFiles, bool validate )
-
Reads a set of shapes in the order given in the
vector of strings.
- Parameters:
- asfFiles - Vector of asf filenames.
validate - Validates that all shapes have the
same number of points.
- Returns:
- True on a valid training set - otherwise false.
- Author:
- Mikkel B. Stegmann
- Version:
- 10-24-2000
bool ReadDir( const CString &path, bool validate )
-
Scans a dir for annotations (.asf) and read shapes
in alphabetical order.
- Parameters:
- path - Full path to annotations.
validate - Validates that all shapes have the
same number of points.
- Returns:
- True on a valid training set - otherwise false.
- Author:
- Mikkel B. Stegmann
- Version:
- 10-24-2000
void Rel2Abs( int rfactor )
-
Converts all shapes with relative coordinates to
absolute. Unfortunately this requires to read the
headers of all host images. VisSDK does not
provide any operation for this. Thus, all images
are one by one read into memory and discarded again
to obtain height and width. Very costly :-(
- Parameters:
- rfactor - Optional reduction factor. Performs a scaling of the
the shape by 1/rfactor. Default 1 i.e. no scaling.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 10-25-2000