DGtal  1.4.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)
35 #define MostCenteredMaximalSegmentEstimator_RECURSES
36 
37 #if !defined MostCenteredMaximalSegmentEstimator_h
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 
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 
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)
Aim: A model of CLocalCurveGeometricEstimator that assigns to each element of a (sub)range a quantity...
BOOST_STATIC_ASSERT((boost::is_same< SegmentComputer, typename SCEstimator::SegmentComputer >::value))
BOOST_CONCEPT_ASSERT((concepts::CSegmentComputerEstimator< SCEstimator >))
void init(const ConstIterator &itb, const ConstIterator &ite)
SaturatedSegmentation< SegmentComputer > Segmentation
OutputIterator endEval(const ConstIterator &itb, const ConstIterator &ite, ConstIterator &itCurrent, SegmentIterator &first, SegmentIterator &last, OutputIterator result, CirculatorType)
BOOST_CONCEPT_ASSERT((concepts::CForwardSegmentComputer< SegmentComputer >))
MostCenteredMaximalSegmentEstimator & operator=(const MostCenteredMaximalSegmentEstimator &other)
Quantity eval(const ConstIterator &it, const double h=1.)
OutputIterator eval(const ConstIterator &itb, const ConstIterator &ite, OutputIterator result, const double h=1.)
MostCenteredMaximalSegmentEstimator(const MostCenteredMaximalSegmentEstimator &other)
OutputIterator endEval(const ConstIterator &itb, const ConstIterator &ite, ConstIterator &itCurrent, SegmentIterator &first, SegmentIterator &last, OutputIterator result)
MostCenteredMaximalSegmentEstimator(const SegmentComputer &aSegmentComputer, const SCEstimator &aSCEstimator)
BOOST_CONCEPT_ASSERT((concepts::CCurveLocalGeometricEstimator< SCEstimator >))
OutputIterator endEval(const ConstIterator &, const ConstIterator &ite, ConstIterator &itCurrent, SegmentIterator &, SegmentIterator &last, OutputIterator result, IteratorType)
Aim: Specific iterator to visit all the maximal segments of a saturated segmentation.
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range gi...
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: This concept describes an object that can process a range so as to return one estimated quantity...
Aim: Defines the concept describing a forward segment computer. Like any model of CIncrementalSegment...
Aim: This concept is a refinement of CCurveLocalGeometricEstimator devoted to the estimation of a geo...
ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 > SegmentComputer