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, 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 SegmentsIdsMatrixT & | m_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... | |
Baatz based Segments merger.
Definition at line 226 of file SegmenterRegionGrowingStrategy.h.
te::rp::SegmenterRegionGrowingStrategy::BaatzMerger::BaatzMerger | ( | const double & | colorWeight, |
const double & | compactnessWeight, | ||
const std::vector< double > & | bandsWeights, | ||
const SegmentsIdsMatrixT & | segmentsIds, | ||
Matrix< SegmenterRegionGrowingSegment > & | segmentsMatrix | ||
) |
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. |
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.
|
virtual |
Returns a dimilarity index between this and the other segment.
segment1Ptr | A pointer to the first segment. |
segment2Ptr | A pointer to the second segment. |
mergePreviewSegPtr | A pointer to a valid segment where the merged features values will be stored (when aplicable). |
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.
|
virtual |
Merge specific segment features from both segments into the first segment.
segment1Ptr | The first segment. |
segment2Ptr | A pointer to the second segment. |
mergePreviewSegPtr | A 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.
|
virtual |
Update the internal state.
Implements te::rp::SegmenterRegionGrowingStrategy::Merger.
Definition at line 559 of file SegmenterRegionGrowingStrategy.cpp.
References BAATZ_CO, BAATZ_SM, and te::rp::SegmenterRegionGrowingSegment::m_features.
|
protected |
The gains applied to normalize the compactness value.
Definition at line 270 of file SegmenterRegionGrowingStrategy.h.
|
protected |
The offsets applied to normalize the compactness value.
Definition at line 268 of file SegmenterRegionGrowingStrategy.h.
|
protected |
The gains applied to normalize the smoothness value.
Definition at line 274 of file SegmenterRegionGrowingStrategy.h.
|
protected |
The offsets applied to normalize the smoothness value.
Definition at line 272 of file SegmenterRegionGrowingStrategy.h.
|
protected |
The number of features (bands).
Definition at line 266 of file SegmenterRegionGrowingStrategy.h.
Referenced by BaatzMerger().
|
protected |
A vector where each bands weight are stored.
Definition at line 280 of file SegmenterRegionGrowingStrategy.h.
Referenced by BaatzMerger().
|
protected |
The weight given to the color component, deafult:0.5, valid range: [0,1].
Definition at line 276 of file SegmenterRegionGrowingStrategy.h.
|
protected |
The weight given to the compactness component, deafult:0.5, valid range: [0,1].
Definition at line 278 of file SegmenterRegionGrowingStrategy.h.
|
protected |
A reference to an external valid structure where each all segments IDs are stored.
Definition at line 262 of file SegmenterRegionGrowingStrategy.h.
|
protected |
A reference to an external valid segments matrix..
Definition at line 264 of file SegmenterRegionGrowingStrategy.h.