DGtal  1.3.beta
MostCenteredMaximalSegmentEstimator.h
1 
17 #pragma once
18 
31 #if defined(MostCenteredMaximalSegmentEstimator_RECURSES)
32 #error Recursive header files inclusion detected in MostCenteredMaximalSegmentEstimator.h
33 #else // defined(MostCenteredMaximalSegmentEstimator_RECURSES)
34 
35 #define MostCenteredMaximalSegmentEstimator_RECURSES
36 
37 #if !defined MostCenteredMaximalSegmentEstimator_h
38 
39 #define MostCenteredMaximalSegmentEstimator_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <list>
45 
46 #include "DGtal/base/Common.h"
47 #include "DGtal/base/Exceptions.h"
48 #include "DGtal/base/Circulator.h"
49 
50 #include "DGtal/geometry/curves/estimation/CSegmentComputerEstimator.h"
51 #include "DGtal/geometry/curves/CForwardSegmentComputer.h"
52 #include "DGtal/geometry/curves/SaturatedSegmentation.h"
53 
55 
56 namespace DGtal
57 {
58 
60  // template class MostCenteredMaximalSegmentEstimator
82  template <typename SegmentComputer, typename SCEstimator>
84  {
85 
88  BOOST_STATIC_ASSERT(( boost::is_same< SegmentComputer,
89  typename SCEstimator::SegmentComputer >::value ));
91 
92  // ----------------------- Types ------------------------------
93  public:
94 
96  typedef typename SCEstimator::Quantity Quantity;
97 
100 
101  // ----------------------- Standard services ------------------------------
102  public:
103 
108 
114  MostCenteredMaximalSegmentEstimator(const SegmentComputer& aSegmentComputer,
115  const SCEstimator& aSCEstimator);
116 
121 
122  // ----------------------- Interface --------------------------------------
123  public:
124 
130  void init( const ConstIterator& itb, const ConstIterator& ite );
131 
141  Quantity eval(const ConstIterator& it, const double h = 1.);
142 
157  template <typename OutputIterator>
158  OutputIterator eval(const ConstIterator& itb, const ConstIterator& ite,
159  OutputIterator result, const double h = 1.);
160 
161 
166  bool isValid() const;
167 
168  // ------------------------- Protected Datas ------------------------------
169  protected:
170 
171  // ------------------------- Private Datas --------------------------------
172  private:
173 
176 
179 
181  SCEstimator mySCEstimator;
182 
183  // ------------------------- Internal services ------------------------------
184 
185  private:
186 
201  template <typename OutputIterator>
202  OutputIterator endEval(const ConstIterator& itb, const ConstIterator& ite, ConstIterator& itCurrent,
203  SegmentIterator& first, SegmentIterator& last,
204  OutputIterator result);
205 
206  template <typename OutputIterator>
207  OutputIterator endEval(const ConstIterator& /*itb*/, const ConstIterator& ite, ConstIterator& itCurrent,
208  SegmentIterator& /*first*/, SegmentIterator& last,
209  OutputIterator result, IteratorType);
210 
211  template <typename OutputIterator>
212  OutputIterator endEval(const ConstIterator& itb, const ConstIterator& ite, ConstIterator& itCurrent,
213  SegmentIterator& first, SegmentIterator& last,
214  OutputIterator result, CirculatorType);
215 
216  // ------------------------- Hidden services ------------------------------
217 
218  private:
219 
226 
234 
235 
236  }; // end of class MostCenteredMaximalSegmentEstimator
237 
238 } // namespace DGtal
239 
240 
242 // Includes inline functions.
243 #include "DGtal/geometry/curves/estimation/MostCenteredMaximalSegmentEstimator.ih"
244 #include "DGtal/geometry/curves/estimation/SegmentComputerEstimators.h"
245 
246 // //
248 
249 #endif // !defined MostCenteredMaximalSegmentEstimator_h
250 
251 #undef MostCenteredMaximalSegmentEstimator_RECURSES
252 #endif // else defined(MostCenteredMaximalSegmentEstimator_RECURSES)
DGtal::concepts::CCurveLocalGeometricEstimator
Aim: This concept describes an object that can process a range so as to return one estimated quantity...
Definition: CCurveLocalGeometricEstimator.h:98
DGtal::concepts::CSegmentComputerEstimator
Aim: This concept is a refinement of CCurveLocalGeometricEstimator devoted to the estimation of a geo...
Definition: CSegmentComputerEstimator.h:97
ConstIterator
MyDigitalSurface::ConstIterator ConstIterator
Definition: greedy-plane-segmentation-ex2.cpp:93
DGtal::ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 >
SegmentComputer
ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 > SegmentComputer
Definition: testArithmeticalDSSComputerOnSurfels.cpp:55
DGtal::MostCenteredMaximalSegmentEstimator::mySC
SegmentComputer mySC
Definition: MostCenteredMaximalSegmentEstimator.h:178
DGtal::MostCenteredMaximalSegmentEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CForwardSegmentComputer< SegmentComputer >))
DGtal::MostCenteredMaximalSegmentEstimator::operator=
MostCenteredMaximalSegmentEstimator & operator=(const MostCenteredMaximalSegmentEstimator &other)
DGtal::MostCenteredMaximalSegmentEstimator::init
void init(const ConstIterator &itb, const ConstIterator &ite)
DGtal::MostCenteredMaximalSegmentEstimator::myBegin
ConstIterator myBegin
Definition: MostCenteredMaximalSegmentEstimator.h:175
DGtal::SaturatedSegmentation::SegmentComputerIterator
Aim: Specific iterator to visit all the maximal segments of a saturated segmentation.
Definition: SaturatedSegmentation.h:179
DGtal::MostCenteredMaximalSegmentEstimator
Aim: A model of CLocalCurveGeometricEstimator that assigns to each element of a (sub)range a quantity...
Definition: MostCenteredMaximalSegmentEstimator.h:83
DGtal::ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 >::ConstIterator
std::vector< Z2i::Point >::const_iterator ConstIterator
Definition: ArithmeticalDSSComputer.h:95
DGtal::MostCenteredMaximalSegmentEstimator::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((boost::is_same< SegmentComputer, typename SCEstimator::SegmentComputer >::value))
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::MostCenteredMaximalSegmentEstimator::mySCEstimator
SCEstimator mySCEstimator
Definition: MostCenteredMaximalSegmentEstimator.h:181
DGtal::MostCenteredMaximalSegmentEstimator::~MostCenteredMaximalSegmentEstimator
~MostCenteredMaximalSegmentEstimator()
Definition: MostCenteredMaximalSegmentEstimator.h:120
DGtal::MostCenteredMaximalSegmentEstimator::myEnd
ConstIterator myEnd
Definition: MostCenteredMaximalSegmentEstimator.h:175
DGtal::MostCenteredMaximalSegmentEstimator::ConstIterator
SegmentComputer::ConstIterator ConstIterator
Definition: MostCenteredMaximalSegmentEstimator.h:95
DGtal::MostCenteredMaximalSegmentEstimator::SegmentIterator
Segmentation::SegmentComputerIterator SegmentIterator
Definition: MostCenteredMaximalSegmentEstimator.h:99
DGtal::CirculatorType
Definition: IteratorCirculatorTraits.h:52
DGtal::MostCenteredMaximalSegmentEstimator::endEval
OutputIterator endEval(const ConstIterator &itb, const ConstIterator &ite, ConstIterator &itCurrent, SegmentIterator &first, SegmentIterator &last, OutputIterator result)
DGtal::concepts::CForwardSegmentComputer
Aim: Defines the concept describing a forward segment computer. Like any model of CIncrementalSegment...
Definition: CForwardSegmentComputer.h:101
DGtal::IteratorType
Definition: IteratorCirculatorTraits.h:51
DGtal::MostCenteredMaximalSegmentEstimator::eval
Quantity eval(const ConstIterator &it, const double h=1.)
DGtal::SaturatedSegmentation
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range gi...
Definition: SaturatedSegmentation.h:153
DGtal::MostCenteredMaximalSegmentEstimator::Quantity
SCEstimator::Quantity Quantity
Definition: MostCenteredMaximalSegmentEstimator.h:96
DGtal::MostCenteredMaximalSegmentEstimator::isValid
bool isValid() const
DGtal::MostCenteredMaximalSegmentEstimator::MostCenteredMaximalSegmentEstimator
MostCenteredMaximalSegmentEstimator()=delete
DGtal::MostCenteredMaximalSegmentEstimator::Segmentation
SaturatedSegmentation< SegmentComputer > Segmentation
Definition: MostCenteredMaximalSegmentEstimator.h:98