All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::rp::SegmenterRegionGrowingStrategy::BaatzMerger Class Reference

Baatz based Segments merger. More...

#include <SegmenterRegionGrowingStrategy.h>

Inheritance diagram for te::rp::SegmenterRegionGrowingStrategy::BaatzMerger:
te::rp::SegmenterRegionGrowingStrategy::Merger

Public Member Functions

 BaatzMerger (const double &colorWeight, const double &compactnessWeight, const std::vector< double > &bandsWeights, const SegmentsIdsMatrixT &segmentsIds, Matrix< SegmenterRegionGrowingSegment > &segmentsMatrix)
 Default constructor. More...
 
SegmenterRegionGrowingSegment::FeatureType getDissimilarity (SegmenterRegionGrowingSegment const *const segment1Ptr, SegmenterRegionGrowingSegment const *const segment2Ptr, SegmenterRegionGrowingSegment *const mergePreviewSegPtr) const
 Returns a dimilarity index between this and the other segment. More...
 
void mergeFeatures (SegmenterRegionGrowingSegment *const segment1Ptr, SegmenterRegionGrowingSegment const *const segment2Ptr, SegmenterRegionGrowingSegment const *const mergePreviewSegPtr) const
 Merge specific segment features from both segments into the first segment. More...
 
void update ()
 Update the internal state. More...
 
 ~BaatzMerger ()
 

Protected Attributes

SegmenterRegionGrowingSegment::FeatureType m_allSegsCompactnessGain
 The gains applied to normalize the compactness value. More...
 
SegmenterRegionGrowingSegment::FeatureType m_allSegsCompactnessOffset
 The offsets applied to normalize the compactness value. More...
 
SegmenterRegionGrowingSegment::FeatureType m_allSegsSmoothnessGain
 The gains applied to normalize the smoothness value. More...
 
SegmenterRegionGrowingSegment::FeatureType m_allSegsSmoothnessOffset
 The offsets applied to normalize the smoothness value. More...
 
unsigned int m_bandsNumber
 The number of features (bands). More...
 
std::vector
< SegmenterRegionGrowingSegment::FeatureType
m_bandsWeights
 A vector where each bands weight are stored. More...
 
SegmenterRegionGrowingSegment::FeatureType m_colorWeight
 The weight given to the color component, deafult:0.5, valid range: [0,1]. More...
 
SegmenterRegionGrowingSegment::FeatureType m_compactnessWeight
 The weight given to the compactness component, deafult:0.5, valid range: [0,1]. More...
 
const SegmentsIdsMatrixTm_segmentsIds
 A reference to an external valid structure where each all segments IDs are stored. More...
 
Matrix
< SegmenterRegionGrowingSegment > & 
m_segmentsMatrix
 A reference to an external valid segments matrix.. More...
 

Detailed Description

Baatz based Segments merger.

Definition at line 226 of file SegmenterRegionGrowingStrategy.h.

Constructor & Destructor Documentation

te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::BaatzMerger ( const double &  colorWeight,
const double &  compactnessWeight,
const std::vector< double > &  bandsWeights,
const SegmentsIdsMatrixT segmentsIds,
Matrix< SegmenterRegionGrowingSegment > &  segmentsMatrix 
)

Default constructor.

Parameters
bandsWeightsA reference to an external valid structure where each bands weight are stored.
segmentsIds//!< A reference to an external valid structure where all segments IDs are stored.
segmentsMatrix//!< A reference to an external valid segments matrix.
colorWeight//!< The weight given to the color component, deafult:0.5, valid range: [0,1].
compactnessWeight//!< The weight given to the compactness component, deafult:0.5, valid range: [0,1].

Definition at line 225 of file SegmenterRegionGrowingStrategy.cpp.

References m_bandsNumber, and m_bandsWeights.

te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::~BaatzMerger ( )

Definition at line 251 of file SegmenterRegionGrowingStrategy.cpp.

Member Function Documentation

SegmenterRegionGrowingSegment::FeatureType te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::getDissimilarity ( SegmenterRegionGrowingSegment const *const  segment1Ptr,
SegmenterRegionGrowingSegment const *const  segment2Ptr,
SegmenterRegionGrowingSegment *const  mergePreviewSegPtr 
) const
virtual

Returns a dimilarity index between this and the other segment.

Parameters
segment1PtrA pointer to the first segment.
segment2PtrA pointer to the second segment.
mergePreviewSegPtrA pointer to a valid segment where the merged features values will be stored (when aplicable).
Returns
A similarity index between this and the other segment ( normalized between 0 and 1 ).

Implements te::rp::SegmenterRegionGrowingStrategy::Merger.

Definition at line 255 of file SegmenterRegionGrowingStrategy.cpp.

References BAATZ_CO, BAATZ_EL, BAATZ_SM, BAATZ_SS, BAATZ_ST, BAATZ_SU, te::rp::SegmenterRegionGrowingStrategy::getTouchingEdgeLength(), te::rp::SegmenterRegionGrowingSegment::m_features, te::rp::SegmenterRegionGrowingSegment::m_id, te::rp::SegmenterRegionGrowingSegment::m_size, te::rp::SegmenterRegionGrowingSegment::m_xBound, te::rp::SegmenterRegionGrowingSegment::m_xStart, te::rp::SegmenterRegionGrowingSegment::m_yBound, te::rp::SegmenterRegionGrowingSegment::m_yStart, and TERP_DEBUG_TRUE_OR_THROW.

void te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::mergeFeatures ( SegmenterRegionGrowingSegment *const  segment1Ptr,
SegmenterRegionGrowingSegment const *const  segment2Ptr,
SegmenterRegionGrowingSegment const *const  mergePreviewSegPtr 
) const
virtual

Merge specific segment features from both segments into the first segment.

Parameters
segment1PtrThe first segment.
segment2PtrA pointer to the second segment.
mergePreviewSegPtrA pointer to a valid segment where the merged features values were be stored by calling getDissimilarityIndex (when aplicable).

Implements te::rp::SegmenterRegionGrowingStrategy::Merger.

Definition at line 534 of file SegmenterRegionGrowingStrategy.cpp.

References te::rp::SegmenterRegionGrowingSegment::m_features, te::rp::SegmenterRegionGrowingSegment::m_size, te::rp::SegmenterRegionGrowingSegment::m_xBound, te::rp::SegmenterRegionGrowingSegment::m_xStart, te::rp::SegmenterRegionGrowingSegment::m_yBound, and te::rp::SegmenterRegionGrowingSegment::m_yStart.

void te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::update ( )
virtual

Member Data Documentation

SegmenterRegionGrowingSegment::FeatureType te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_allSegsCompactnessGain
protected

The gains applied to normalize the compactness value.

Definition at line 270 of file SegmenterRegionGrowingStrategy.h.

SegmenterRegionGrowingSegment::FeatureType te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_allSegsCompactnessOffset
protected

The offsets applied to normalize the compactness value.

Definition at line 268 of file SegmenterRegionGrowingStrategy.h.

SegmenterRegionGrowingSegment::FeatureType te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_allSegsSmoothnessGain
protected

The gains applied to normalize the smoothness value.

Definition at line 274 of file SegmenterRegionGrowingStrategy.h.

SegmenterRegionGrowingSegment::FeatureType te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_allSegsSmoothnessOffset
protected

The offsets applied to normalize the smoothness value.

Definition at line 272 of file SegmenterRegionGrowingStrategy.h.

unsigned int te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_bandsNumber
protected

The number of features (bands).

Definition at line 266 of file SegmenterRegionGrowingStrategy.h.

Referenced by BaatzMerger().

std::vector< SegmenterRegionGrowingSegment::FeatureType > te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_bandsWeights
protected

A vector where each bands weight are stored.

Definition at line 280 of file SegmenterRegionGrowingStrategy.h.

Referenced by BaatzMerger().

SegmenterRegionGrowingSegment::FeatureType te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_colorWeight
protected

The weight given to the color component, deafult:0.5, valid range: [0,1].

Definition at line 276 of file SegmenterRegionGrowingStrategy.h.

SegmenterRegionGrowingSegment::FeatureType te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_compactnessWeight
protected

The weight given to the compactness component, deafult:0.5, valid range: [0,1].

Definition at line 278 of file SegmenterRegionGrowingStrategy.h.

const SegmentsIdsMatrixT& te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_segmentsIds
protected

A reference to an external valid structure where each all segments IDs are stored.

Definition at line 262 of file SegmenterRegionGrowingStrategy.h.

Matrix< SegmenterRegionGrowingSegment >& te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_segmentsMatrix
protected

A reference to an external valid segments matrix..

Definition at line 264 of file SegmenterRegionGrowingStrategy.h.


The documentation for this class was generated from the following files: