mds::seg::CTriMesh Class Reference

#include <mdsTriMesh.h>

Inheritance diagram for mds::seg::CTriMesh:

Inheritance graph
[legend]
List of all members.

Detailed Description

Class representing adaptive triangular mesh.


Public Types

typedef std::vector< CTriFeaturestSegments
 Vector of image features.
typedef mds::base::CSharedPtr<
CTriMesh
tSmartPtr
 Smart pointer type.

Public Member Functions

bool classifyAdjacent (double dBThreshold=DEFAULT_DISTANCE_THRESHOLD)
 Classify all non-classified triangles with respect to the neighbours.
 CTriMesh (mds::img::CDImage *pEdgeImage)
 Constructor.
 CTriMesh ()
 Default constructor.
template<class S>
void deserialize (mds::mod::CChannelSerializer< S > &Reader)
 Deserializes the triangular mesh.
bool edgeSplitting (double dMinLength=DEFAULT_MIN_EDGE_LENGTH, double dOrientThreshold=DEFAULT_SPLITTING_THRESHOLD)
 Adaptation of the triangular mesh to the underlying image.
bool evaluateFeatures (bool bSkipSmall=true)
 Evaluates image features of all triangles in the mesh.
bool evaluateSegmentFeatures (bool bSkipSmall=true)
 Evaluates features of all segments in the mesh.
mds::img::CDImage * getEdgeImagePtr ()
 Returns pointer to the underlying edge image.
mds::img::CDImage * getImagePtr ()
 Returns pointer to the underlying image.
int getNumOfSegments () const
 Returns number of regions.
tSegmentsgetSegments ()
 Returns vector of image features.
bool init (double dThreshold=DEFAULT_INIT_THRESHOLD, tSize CellSize=DEFAULT_CELL, tSize NumOfNodes=DEFAULT_NUMBER_OF_NODES, double dMinEdgeLength=DEFAULT_MIN_EDGE_LENGTH)
 Initializes the Delaunay triangulation.
 MDS_ENTITY_BLOCK_SIZE (4096)
 Standard method getEntityBlockSize().
 MDS_ENTITY_COMPRESSION (mds::mod::CC_RAW)
 Standard method getEntityCompression().
 MDS_ENTITY_NAME ("TriMesh")
 Standard method getEntityName().
bool noiseReduction ()
 Removes noisy (wrongly classified) tetrahedrons in the mesh.
bool regionGrowing (CTriSimilarityMeasure &Measure, double dBThreshold=DEFAULT_DISTANCE_THRESHOLD)
 Simple region growing segmentation.
bool regionMerging (CTriSimilarityMeasure &Measure, double dBThreshold=DEFAULT_DISTANCE_THRESHOLD, tSize NumOfRegions=-1)
 Aglomerative merging of regions in the mesh.
bool saveSTL (mds::mod::CChannel &Channel)
 Writes triangular mesh to a given output channel in STL format.
bool saveVRML (mds::mod::CChannel &Channel)
 Writes triangular mesh to a given output channel in VRML format.
template<class S>
void serialize (mds::mod::CChannelSerializer< S > &Writer)
 Serializes the triangular mesh.
void setEdgeImage (mds::img::CDImage *pEdgeImage)
 Selection of the image for segmentation.
void setImage (mds::img::CDImage *pImage)
 Selection of the image for segmentation.
void setNumOfSegments (int i)
 Sets the number of regions.
bool triangleSplitting (CTriHomogeneityMeasure &Measure, double dMinLength=DEFAULT_MIN_EDGE_LENGTH)
 Adaptation of the triangular mesh to the underlying image.
void visualize (mds::img::CDImage *pImage)
 Visualizes the triangular mesh.
virtual ~CTriMesh ()
 Virtual destructor.

Static Public Attributes

static const tSize DEFAULT_CELL = 5
 Default parameters.
static const tSize DEFAULT_CELL_MARGIN = 1
static const double DEFAULT_DISTANCE_THRESHOLD = 1.5
static const double DEFAULT_INIT_THRESHOLD = 0.5
static const double DEFAULT_SPLITTING_THRESHOLD = 0.5

Protected Types

typedef std::vector< vctl::MCPoint3D > tPoints
 Vector of points.

Protected Member Functions

bool checkBoundaryEdge (vctl::MCEdge *pEdge, double dThreshold=DEFAULT_DISTANCE_THRESHOLD)
 Checks if a given edge is a boundary edge.
void reassignRegions ()
 Eliminates unused indexes of regions shaking down all currently assigned indexes.
bool splitEdge (vctl::MCEdge *pEdge, double dMinLength, double dThreshold, tPoints &Points)
 Splits a given edge.
bool splitTriangle (vctl::MCTri *pTriangle, double dMinLength)
 Splits a given triangle.

Static Protected Member Functions

static void edgeSplittingInsertFunc (vctl::MCTri *pTriangle, CDelaunayTri *pMesh)
 Inserts triangle edges to the list of edges.
static void triangleSplittingInsertFunc (vctl::MCTri *pTriangle, CDelaunayTri *pMesh)
 Evaluates triangle homogeneity and inserts it to the sorted queue.
static void triangleSplittingRemoveFunc (vctl::MCTri *pTriangle, CDelaunayTri *pMesh)
 Unsorts triangle from the queue.

Protected Attributes

int m_iNumOfSegments
 Number of segments in the mesh.
CTriHomogeneityMeasurem_pHomogeneityMeasure
 Currently used homogeneity measure.
tSegments m_Segments
 Vector of image features extracted for every region.
mds::img::CDImagePtr m_spEdgeImage
 Pointer to the underlying edge image.
mds::img::CDImagePtr m_spImage
 Pointer to the underlying image.

Friends

class mds::base::CSharedPtr< CTriMesh >


Member Typedef Documentation

typedef std::vector<vctl::MCPoint3D> mds::seg::CTriMesh::tPoints [protected]
 

Vector of points.

typedef std::vector<CTriFeatures> mds::seg::CTriMesh::tSegments
 

Vector of image features.

typedef mds::base::CSharedPtr< CTriMesh > mds::seg::CTriMesh::tSmartPtr
 

Smart pointer type.

  • Declares type tSmartPtr.

Reimplemented from mds::seg::CDelaunayTri.


Constructor & Destructor Documentation

mds::seg::CTriMesh::CTriMesh  ) 
 

Default constructor.

mds::seg::CTriMesh::CTriMesh mds::img::CDImage *  pEdgeImage  ) 
 

Constructor.

mds::seg::CTriMesh::~CTriMesh  )  [virtual]
 

Virtual destructor.


Member Function Documentation

bool mds::seg::CTriMesh::checkBoundaryEdge vctl::MCEdge *  pEdge,
double  dThreshold = DEFAULT_DISTANCE_THRESHOLD
[protected]
 

Checks if a given edge is a boundary edge.

  • Returns true if the edge and some image edge are parallel.

bool mds::seg::CTriMesh::classifyAdjacent double  dBThreshold = DEFAULT_DISTANCE_THRESHOLD  ) 
 

Classify all non-classified triangles with respect to the neighbours.

  • This method doesn't use image features for classification!
  • Both images must be set!

template<class S>
void mds::seg::CTriMesh::deserialize mds::mod::CChannelSerializer< S > &  Reader  )  [inline]
 

Deserializes the triangular mesh.

Reimplemented from mds::seg::CDelaunayTri.

bool mds::seg::CTriMesh::edgeSplitting double  dMinLength = DEFAULT_MIN_EDGE_LENGTH,
double  dOrientThreshold = DEFAULT_SPLITTING_THRESHOLD
 

Adaptation of the triangular mesh to the underlying image.

  • Edge splitting algorithm.
  • Both images must be set!

void mds::seg::CTriMesh::edgeSplittingInsertFunc vctl::MCTri *  pTriangle,
CDelaunayTri pMesh
[static, protected]
 

Inserts triangle edges to the list of edges.

bool mds::seg::CTriMesh::evaluateFeatures bool  bSkipSmall = true  ) 
 

Evaluates image features of all triangles in the mesh.

  • Underlying image must be set!

bool mds::seg::CTriMesh::evaluateSegmentFeatures bool  bSkipSmall = true  ) 
 

Evaluates features of all segments in the mesh.

  • Underlying image must be set!
  • Triangles in the mesh must be classified to regions!

mds::img::CDImage* mds::seg::CTriMesh::getEdgeImagePtr  )  [inline]
 

Returns pointer to the underlying edge image.

mds::img::CDImage* mds::seg::CTriMesh::getImagePtr  )  [inline]
 

Returns pointer to the underlying image.

int mds::seg::CTriMesh::getNumOfSegments  )  const [inline]
 

Returns number of regions.

tSegments& mds::seg::CTriMesh::getSegments  )  [inline]
 

Returns vector of image features.

bool mds::seg::CTriMesh::init double  dThreshold = DEFAULT_INIT_THRESHOLD,
tSize  CellSize = DEFAULT_CELL,
tSize  NumOfNodes = DEFAULT_NUMBER_OF_NODES,
double  dMinEdgeLength = DEFAULT_MIN_EDGE_LENGTH
 

Initializes the Delaunay triangulation.

  • Uses vertex detector to initialize the list of vertices.
  • Removes all triangles.
  • Underlying edge image must be set.

mds::seg::CTriMesh::MDS_ENTITY_BLOCK_SIZE 4096   ) 
 

Standard method getEntityBlockSize().

Reimplemented from mds::seg::CDelaunayTri.

mds::seg::CTriMesh::MDS_ENTITY_COMPRESSION mds::mod::CC_RAW   ) 
 

Standard method getEntityCompression().

Reimplemented from mds::seg::CDelaunayTri.

mds::seg::CTriMesh::MDS_ENTITY_NAME "TriMesh"   ) 
 

Standard method getEntityName().

bool mds::seg::CTriMesh::noiseReduction  ) 
 

Removes noisy (wrongly classified) tetrahedrons in the mesh.

  • Principle of the noise removal algorithm is similar to the median filtering approach which is well known in image processing.
  • This method doesn't use image features for classification!

void mds::seg::CTriMesh::reassignRegions  )  [protected]
 

Eliminates unused indexes of regions shaking down all currently assigned indexes.

bool mds::seg::CTriMesh::regionGrowing CTriSimilarityMeasure Measure,
double  dBThreshold = DEFAULT_DISTANCE_THRESHOLD
 

Simple region growing segmentation.

Every region grows while a given similarity predicate holds and boundary edge is not touched.

  • Image features must be evaluated!
  • Both images must be set!

bool mds::seg::CTriMesh::regionMerging CTriSimilarityMeasure Measure,
double  dBThreshold = DEFAULT_DISTANCE_THRESHOLD,
tSize  NumOfRegions = -1
 

Aglomerative merging of regions in the mesh.

  • Evaluates image features.
  • Both images must be set!

bool mds::seg::CTriMesh::saveSTL mds::mod::CChannel &  Channel  ) 
 

Writes triangular mesh to a given output channel in STL format.

  • Returns false on failure.
  • Modified Premysl Krsek's original code.

bool mds::seg::CTriMesh::saveVRML mds::mod::CChannel &  Channel  ) 
 

Writes triangular mesh to a given output channel in VRML format.

  • Returns false on failure.
  • Modified Premysl Krsek's original code.

template<class S>
void mds::seg::CTriMesh::serialize mds::mod::CChannelSerializer< S > &  Writer  )  [inline]
 

Serializes the triangular mesh.

Reimplemented from mds::seg::CDelaunayTri.

void mds::seg::CTriMesh::setEdgeImage mds::img::CDImage *  pEdgeImage  )  [inline]
 

Selection of the image for segmentation.

void mds::seg::CTriMesh::setImage mds::img::CDImage *  pImage  )  [inline]
 

Selection of the image for segmentation.

void mds::seg::CTriMesh::setNumOfSegments int  i  )  [inline]
 

Sets the number of regions.

bool mds::seg::CTriMesh::splitEdge vctl::MCEdge *  pEdge,
double  dMinLength,
double  dThreshold,
tPoints Points
[protected]
 

Splits a given edge.

  • Returns true if the edge was divided.

bool mds::seg::CTriMesh::splitTriangle vctl::MCTri *  pTriangle,
double  dMinLength
[protected]
 

Splits a given triangle.

  • Returns true if the triangle was divided.

bool mds::seg::CTriMesh::triangleSplitting CTriHomogeneityMeasure Measure,
double  dMinLength = DEFAULT_MIN_EDGE_LENGTH
 

Adaptation of the triangular mesh to the underlying image.

  • Triangle splitting algorithm.
  • Both images must be set!

void mds::seg::CTriMesh::triangleSplittingInsertFunc vctl::MCTri *  pTriangle,
CDelaunayTri pMesh
[static, protected]
 

Evaluates triangle homogeneity and inserts it to the sorted queue.

void mds::seg::CTriMesh::triangleSplittingRemoveFunc vctl::MCTri *  pTriangle,
CDelaunayTri pMesh
[static, protected]
 

Unsorts triangle from the queue.

void mds::seg::CTriMesh::visualize mds::img::CDImage *  pImage  ) 
 

Visualizes the triangular mesh.

  • Draws all triangles as simple lines to a given image.


Friends And Related Function Documentation

friend class mds::base::CSharedPtr< CTriMesh > [friend]
 


Member Data Documentation

const tSize mds::seg::CTriMesh::DEFAULT_CELL = 5 [static]
 

Default parameters.

const tSize mds::seg::CTriMesh::DEFAULT_CELL_MARGIN = 1 [static]
 

const double mds::seg::CTriMesh::DEFAULT_DISTANCE_THRESHOLD = 1.5 [static]
 

const double mds::seg::CTriMesh::DEFAULT_INIT_THRESHOLD = 0.5 [static]
 

const double mds::seg::CTriMesh::DEFAULT_SPLITTING_THRESHOLD = 0.5 [static]
 

int mds::seg::CTriMesh::m_iNumOfSegments [protected]
 

Number of segments in the mesh.

CTriHomogeneityMeasure* mds::seg::CTriMesh::m_pHomogeneityMeasure [protected]
 

Currently used homogeneity measure.

tSegments mds::seg::CTriMesh::m_Segments [protected]
 

Vector of image features extracted for every region.

mds::img::CDImagePtr mds::seg::CTriMesh::m_spEdgeImage [protected]
 

Pointer to the underlying edge image.

mds::img::CDImagePtr mds::seg::CTriMesh::m_spImage [protected]
 

Pointer to the underlying image.


The documentation for this class was generated from the following files:
Generated on Thu Mar 11 10:36:35 2010 for MDSTk Extension Libraries by  doxygen 1.4.6-NO