SegmenterRegionGrowingMerger.h
Go to the documentation of this file.
1 /* Copyright (C) 2015 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/rp/SegmenterRegionGrowingMerger.h
22  \brief Segmenter merger used in region growing process.
23  */
24 
25 #ifndef __TERRALIB_RP_INTERNAL_SEGMENTERREGIONGROWINGMERGER_H
26 #define __TERRALIB_RP_INTERNAL_SEGMENTERREGIONGROWINGMERGER_H
27 
29 #include "SegmenterSegmentsBlock.h"
30 
31 #include "Matrix.h"
32 
33 namespace te
34 {
35  namespace rp
36  {
37  /*!
38  \brief Internal segments ids matrix type definition.
39  */
42 
43  /*!
44  \brief Type for dissimilarity.
45  */
46  typedef double DissimilarityTypeT;
47 
48  /*!
49  \class SegmenterRegionGrowingMerger
50  \brief Abstract class for the segments merger.
51  */
52  template< typename FeatureDataTypeT >
54  public:
56  {
57  };
58 
59  /*!
60  \brief Returns a dimilarity index between this and the other segment.
61  \param segment1Ptr A pointer to the first segment.
62  \param segment2Ptr A pointer to the second segment.
63  \param mergePreviewSegPtr A pointer to a valid segment where the merged features values will be stored (when aplicable).
64  \return A similarity index between this and the other segment ( normalized between 0 and 1 ).
65  */
66  virtual DissimilarityTypeT
68  SegmenterRegionGrowingSegment< FeatureDataTypeT > const * const segment2Ptr,
69  SegmenterRegionGrowingSegment< FeatureDataTypeT > * const mergePreviewSegPtr ) const = 0;
70 
71  /*!
72  \brief Merge specific segment features from both segments into the first segment.
73  \param segment1Ptr The first segment.
74  \param segment2Ptr A pointer to the second segment.
75  \param mergePreviewSegPtr A pointer to a valid segment where the merged features values were be stored by calling getDissimilarityIndex (when aplicable).
76  */
77  virtual void mergeFeatures( SegmenterRegionGrowingSegment< FeatureDataTypeT > * const segment1Ptr,
78  SegmenterRegionGrowingSegment< FeatureDataTypeT > const * const segment2Ptr,
79  SegmenterRegionGrowingSegment< FeatureDataTypeT > const * const mergePreviewSegPtr ) const = 0;
80 
81  /*!
82  \brief Update the internal state.
83  \param actSegsListHeadPtr A pointer the the active segments list head.
84  */
85  virtual void update( SegmenterRegionGrowingSegment< FeatureDataTypeT >* const actSegsListHeadPtr ) = 0;
86 
87  /*!
88  \brief Return the required segments features vector size (numer of elements).
89  \return Return the required segments features vector size (numer of elements).
90  */
91  virtual unsigned int getSegmentFeaturesSize() const = 0;
92 
93  protected :
94  /*!
95  \brief Constructor.
96  */
98  {
99  };
100 
101  private :
102  /*!
103  \brief Copy Constructor.
104  */
106 
108  operator=( const SegmenterRegionGrowingMerger& other ) { return other; };
109  };
110  } // end namespace rp
111 } // end namespace te
112 
113 #endif // __TERRALIB_RP_INTERNAL_SEGMENTERREGIONGROWINGMERGER_H
virtual void mergeFeatures(SegmenterRegionGrowingSegment< FeatureDataTypeT > *const segment1Ptr, SegmenterRegionGrowingSegment< FeatureDataTypeT > const *const segment2Ptr, SegmenterRegionGrowingSegment< FeatureDataTypeT > const *const mergePreviewSegPtr) const =0
Merge specific segment features from both segments into the first segment.
double DissimilarityTypeT
Type for dissimilarity.
virtual DissimilarityTypeT getDissimilarity(SegmenterRegionGrowingSegment< FeatureDataTypeT > const *const segment1Ptr, SegmenterRegionGrowingSegment< FeatureDataTypeT > const *const segment2Ptr, SegmenterRegionGrowingSegment< FeatureDataTypeT > *const mergePreviewSegPtr) const =0
Returns a dimilarity index between this and the other segment.
Region Growing segment.
SegmenterRegionGrowingMerger(const SegmenterRegionGrowingMerger &)
Copy Constructor.
URI C++ Library.
Abstract class for the segments merger.
Generic template matrix.
virtual unsigned int getSegmentFeaturesSize() const =0
Return the required segments features vector size (numer of elements).
const SegmenterRegionGrowingMerger & operator=(const SegmenterRegionGrowingMerger &other)
Segments block.
virtual void update(SegmenterRegionGrowingSegment< FeatureDataTypeT > *const actSegsListHeadPtr)=0
Update the internal state.
Matrix< SegmenterSegmentsBlock::SegmentIdDataType > SegmentsIdsMatrixT
Internal segments ids matrix type definition.