kmeans::KMeansSegmenter< T >::Pruner Class Reference

Inheritance diagram for kmeans::KMeansSegmenter< T >::Pruner:

kmeans::Segmenter::RegionPruner List of all members.

Detailed Description

template<class T>
class kmeans::KMeansSegmenter< T >::Pruner

Controls pruning of regions based on size.

The choice of best region is made through comparing measure distance.


Public Types

typedef std::set< int > Alternates

Public Member Functions

 Pruner (const KMeansSegmenter< T > &seg, const LImage< int > &label, const ImageAttr< T > &attr, size_t min_size=10)
virtual ~Pruner ()
const Segmenter::ReplacementgetReplacement () const
 Get the result after pruning, i.e.

Protected Member Functions

virtual bool shouldRemoveRegion (int reg_label) const
 The method that should be over-ridden to tell removeRegions whether to remove a region.
virtual int getReplacementLabel (int current_label, const std::set< int > &alternates) const
 The method that should be over-ridden to provide the way of choosing the alternate label to removeRegions.
virtual void confirmRemoval (vector< RegionPruner::Alternates > &remain, vector< RegionPruner::Alternates > &goaway, vector< bool > &should_remove_this_region) const
 Changes the regions to be prune after seeing the consequences.
virtual void recompute (const std::vector< int > &replacements)
 Recomputes internal data after one pass of pruning.
virtual void getClosebyRegions (int regNo, std::set< int > *closeby)
 uses a cluster relativeDist threshold of 0.3 to decide.

Friends

class Segmenter


Member Typedef Documentation

typedef std::set<int> kmeans::Segmenter::RegionPruner::Alternates [inherited]


Constructor & Destructor Documentation

template<class T>
kmeans::KMeansSegmenter< T >::Pruner::Pruner ( const KMeansSegmenter< T > &  seg,
const LImage< int > &  label,
const ImageAttr< T > &  attr,
size_t  min_size = 10 
)

template<class T>
virtual kmeans::KMeansSegmenter< T >::Pruner::~Pruner (  )  [inline, virtual]


Member Function Documentation

template<class T>
virtual void kmeans::KMeansSegmenter< T >::Pruner::confirmRemoval ( vector< RegionPruner::Alternates > &  remain,
vector< RegionPruner::Alternates > &  goaway,
vector< bool > &  should_remove_this_region 
) const [protected, virtual]

Changes the regions to be prune after seeing the consequences.

Tries to add the bunch of regions to meet size requirements.

template<class T>
virtual void kmeans::KMeansSegmenter< T >::Pruner::getClosebyRegions ( int  regNo,
std::set< int > *  closeby 
) [protected, virtual]

uses a cluster relativeDist threshold of 0.3 to decide.

Reimplemented from kmeans::Segmenter::RegionPruner.

const Segmenter::Replacement& kmeans::Segmenter::RegionPruner::getReplacement (  )  const [inline, inherited]

Get the result after pruning, i.e.

after a call to Segementer::pruneRegions.

template<class T>
virtual int kmeans::KMeansSegmenter< T >::Pruner::getReplacementLabel ( int  current_label,
const std::set< int > &  alternates 
) const [protected, virtual]

The method that should be over-ridden to provide the way of choosing the alternate label to removeRegions.

The set of alternatives will not include candidates for removal, and therefore can be empty.

Implements kmeans::Segmenter::RegionPruner.

template<class T>
virtual void kmeans::KMeansSegmenter< T >::Pruner::recompute ( const std::vector< int > &  replacements  )  [protected, virtual]

Recomputes internal data after one pass of pruning.

Implements kmeans::Segmenter::RegionPruner.

template<class T>
virtual bool kmeans::KMeansSegmenter< T >::Pruner::shouldRemoveRegion ( int  reg_label  )  const [protected, virtual]

The method that should be over-ridden to tell removeRegions whether to remove a region.

Implements kmeans::Segmenter::RegionPruner.


Friends And Related Function Documentation

friend class Segmenter [friend, inherited]


Generated on Fri May 4 13:40:22 2012 for WDSS-IIw2algs by  doxygen 1.4.7