Inheritance diagram for kmeans::KMeansSegmenter< T >::Pruner:
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::Replacement & | getReplacement () 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 |
typedef std::set<int> kmeans::Segmenter::RegionPruner::Alternates [inherited] |
kmeans::KMeansSegmenter< T >::Pruner::Pruner | ( | const KMeansSegmenter< T > & | seg, | |
const LImage< int > & | label, | |||
const ImageAttr< T > & | attr, | |||
size_t | min_size = 10 | |||
) |
virtual kmeans::KMeansSegmenter< T >::Pruner::~Pruner | ( | ) | [inline, virtual] |
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.
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.
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.
virtual void kmeans::KMeansSegmenter< T >::Pruner::recompute | ( | const std::vector< int > & | replacements | ) | [protected, virtual] |
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.
friend class Segmenter [friend, inherited] |