Baatz based Segments merger. More...
#include <SegmenterRegionGrowingStrategy.h>
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 SegmentsIdsMatrixT & | m_segmentsIds |
A reference to an external valid structure where each all segments IDs are stored. More... | |
Baatz based Segments merger.
Definition at line 459 of file SegmenterRegionGrowingStrategy.h.
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.
bandsWeights | A 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.
|
virtual |
Returns a dissimilarity index between this and the other segment (normalized between 0 and 1).
segment1Ptr | A pointer to the first segment. |
segment2Ptr | A pointer to the second segment. |
mergedFeatures | A pointer to a valid segment features instance where the merged features values will be stored. |
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.
|
virtual |
Merge specific segment features from both segments into the first segment.
segment1Ptr | The first segment. |
segment2Ptr | A pointer to the second segment. |
mergedFeatures | A pointer to a valid segment features instance where the merged features values are stored. |
Implements te::rp::SegmenterRegionGrowingStrategy::Merger.
Definition at line 680 of file SegmenterRegionGrowingStrategy.cpp.
References 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_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.
|
virtual |
Update the internal state.
Implements te::rp::SegmenterRegionGrowingStrategy::Merger.
Definition at line 713 of file SegmenterRegionGrowingStrategy.cpp.
References te::rp::SegmenterRegionGrowingStrategy::BaatzBasedSegment::SegmentFeatures::m_compactness, te::rp::SegmenterRegionGrowingStrategy::BaatzBasedSegment::m_features, te::rp::SegmenterRegionGrowingStrategy::BaatzBasedSegment::SegmentFeatures::m_smoothness, te::rp::SegmenterRegionGrowingStrategy::BaatzBasedSegment::SegmentFeatures::m_stdDev, and TERP_DEBUG_TRUE_OR_THROW.
|
protected |
The gains applied to normalize the compactness value.
Definition at line 500 of file SegmenterRegionGrowingStrategy.h.
|
protected |
The offsets applied to normalize the compactness value.
Definition at line 498 of file SegmenterRegionGrowingStrategy.h.
|
protected |
The gains applied to normalize the smoothness value.
Definition at line 504 of file SegmenterRegionGrowingStrategy.h.
|
protected |
The offsets applied to normalize the smoothness value.
Definition at line 502 of file SegmenterRegionGrowingStrategy.h.
|
protected |
The gains applied to normalize the standard deviation value.
Definition at line 496 of file SegmenterRegionGrowingStrategy.h.
Referenced by BaatzMerger().
|
protected |
The offsets applied to normalize the standard deviation value.
Definition at line 494 of file SegmenterRegionGrowingStrategy.h.
Referenced by BaatzMerger().
|
protected |
A vector where each bands weight are stored.
Definition at line 510 of file SegmenterRegionGrowingStrategy.h.
|
protected |
The weight given to the color component, deafult:0.5, valid range: [0,1].
Definition at line 506 of file SegmenterRegionGrowingStrategy.h.
|
protected |
The weight given to the compactness component, deafult:0.5, valid range: [0,1].
Definition at line 508 of file SegmenterRegionGrowingStrategy.h.
|
protected |
A reference to an external valid structure where each all segments are indexed.
Definition at line 514 of file SegmenterRegionGrowingStrategy.h.
|
protected |
A reference to an external valid structure where each all segments IDs are stored.
Definition at line 512 of file SegmenterRegionGrowingStrategy.h.