All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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, const SegmenterRegionGrowingStrategy::SegmentsIndexer &segments)
 Default constructor. More...
 
double getDissimilarityIndex (SegmenterRegionGrowingStrategy::Segment const *const segmen1tPtr, SegmenterRegionGrowingStrategy::Segment const *const segmen2tPtr, SegmenterRegionGrowingStrategy::SegmentFeatures *mergedFeatures) const
 Returns a dissimilarity index between this and the other segment (normalized between 0 and 1). More...
 
void mergeFeatures (SegmenterRegionGrowingStrategy::Segment *const segmen1tPtr, Segment const *const segmen2tPtr, SegmenterRegionGrowingStrategy::SegmentFeatures const *const mergedFeatures) const
 Merge specific segment features from both segments into the first segment. More...
 
void update ()
 Update the internal state. More...
 
 ~BaatzMerger ()
 

Protected Attributes

double m_allSegsCompactnessGain
 The gains applied to normalize the compactness value. More...
 
double m_allSegsCompactnessOffset
 The offsets applied to normalize the compactness value. More...
 
double m_allSegsSmoothnessGain
 The gains applied to normalize the smoothness value. More...
 
double m_allSegsSmoothnessOffset
 The offsets applied to normalize the smoothness value. More...
 
std::vector< double > m_allSegsStdDevGain
 The gains applied to normalize the standard deviation value. More...
 
std::vector< double > m_allSegsStdDevOffsets
 The offsets applied to normalize the standard deviation value. More...
 
std::vector< double > m_bandsWeights
 A vector where each bands weight are stored. More...
 
double m_colorWeight
 The weight given to the color component, deafult:0.5, valid range: [0,1]. More...
 
double m_compactnessWeight
 The weight given to the compactness component, deafult:0.5, valid range: [0,1]. More...
 
const
SegmenterRegionGrowingStrategy::SegmentsIndexer
m_segments
 A reference to an external valid structure where each all segments are indexed. More...
 
const SegmentsIdsMatrixTm_segmentsIds
 A reference to an external valid structure where each all segments IDs are stored. More...
 

Detailed Description

Baatz based Segments merger.

Definition at line 459 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,
const SegmenterRegionGrowingStrategy::SegmentsIndexer segments 
)

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.
segments//!< A reference to an external valid segments indexer structure.
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 387 of file SegmenterRegionGrowingStrategy.cpp.

References m_allSegsStdDevGain, and m_allSegsStdDevOffsets.

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

Definition at line 407 of file SegmenterRegionGrowingStrategy.cpp.

Member Function Documentation

double te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::getDissimilarityIndex ( SegmenterRegionGrowingStrategy::Segment const *const  segment1Ptr,
SegmenterRegionGrowingStrategy::Segment const *const  segment2Ptr,
SegmenterRegionGrowingStrategy::SegmentFeatures mergedFeatures 
) const
virtual

Returns a dissimilarity index between this and the other segment (normalized between 0 and 1).

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

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

Definition at line 411 of file SegmenterRegionGrowingStrategy.cpp.

References te::rp::SegmenterRegionGrowingStrategy::getTouchingEdgeLength(), te::rp::SegmenterRegionGrowingStrategy::BaatzBasedSegment::SegmentFeatures::m_compactness, te::rp::SegmenterRegionGrowingStrategy::BaatzBasedSegment::SegmentFeatures::m_edgeLength, te::rp::SegmenterRegionGrowingStrategy::BaatzBasedSegment::m_features, te::rp::SegmenterRegionGrowingStrategy::SegmentFeatures::m_id, te::rp::SegmenterRegionGrowingStrategy::SegmentFeatures::m_size, te::rp::SegmenterRegionGrowingStrategy::BaatzBasedSegment::SegmentFeatures::m_smoothness, te::rp::SegmenterRegionGrowingStrategy::BaatzBasedSegment::SegmentFeatures::m_squaresSum, te::rp::SegmenterRegionGrowingStrategy::BaatzBasedSegment::SegmentFeatures::m_stdDev, te::rp::SegmenterRegionGrowingStrategy::BaatzBasedSegment::SegmentFeatures::m_sums, te::rp::SegmenterRegionGrowingStrategy::SegmentFeatures::m_xBound, te::rp::SegmenterRegionGrowingStrategy::SegmentFeatures::m_xStart, te::rp::SegmenterRegionGrowingStrategy::SegmentFeatures::m_yBound, te::rp::SegmenterRegionGrowingStrategy::SegmentFeatures::m_yStart, and TERP_DEBUG_TRUE_OR_THROW.

void te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::mergeFeatures ( SegmenterRegionGrowingStrategy::Segment *const  segment1Ptr,
Segment const *const  segment2Ptr,
SegmenterRegionGrowingStrategy::SegmentFeatures const *const  mergedFeatures 
) const
virtual

Member Data Documentation

double te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_allSegsCompactnessGain
protected

The gains applied to normalize the compactness value.

Definition at line 500 of file SegmenterRegionGrowingStrategy.h.

double te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_allSegsCompactnessOffset
protected

The offsets applied to normalize the compactness value.

Definition at line 498 of file SegmenterRegionGrowingStrategy.h.

double te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_allSegsSmoothnessGain
protected

The gains applied to normalize the smoothness value.

Definition at line 504 of file SegmenterRegionGrowingStrategy.h.

double te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_allSegsSmoothnessOffset
protected

The offsets applied to normalize the smoothness value.

Definition at line 502 of file SegmenterRegionGrowingStrategy.h.

std::vector< double > te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_allSegsStdDevGain
protected

The gains applied to normalize the standard deviation value.

Definition at line 496 of file SegmenterRegionGrowingStrategy.h.

Referenced by BaatzMerger().

std::vector< double > te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_allSegsStdDevOffsets
protected

The offsets applied to normalize the standard deviation value.

Definition at line 494 of file SegmenterRegionGrowingStrategy.h.

Referenced by BaatzMerger().

std::vector< double > te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_bandsWeights
protected

A vector where each bands weight are stored.

Definition at line 510 of file SegmenterRegionGrowingStrategy.h.

double te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_colorWeight
protected

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

Definition at line 506 of file SegmenterRegionGrowingStrategy.h.

double te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_compactnessWeight
protected

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

Definition at line 508 of file SegmenterRegionGrowingStrategy.h.

const SegmenterRegionGrowingStrategy::SegmentsIndexer& te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::m_segments
protected

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

Definition at line 514 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 512 of file SegmenterRegionGrowingStrategy.h.


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