DGtal  1.0.0
TwoStepLocalLengthEstimator.h
1 
17 #pragma once
18 
33 #if defined(TwoStepLocalLengthEstimator_RECURSES)
34 #error Recursive header files inclusion detected in TwoStepLocalLengthEstimator.h
35 #else // defined(TwoStepLocalLengthEstimator_RECURSES)
36 
37 #define TwoStepLocalLengthEstimator_RECURSES
38 
39 #if !defined TwoStepLocalLengthEstimator_h
40 
41 #define TwoStepLocalLengthEstimator_h
42 
44 // Inclusions
45 #include <iostream>
46 #include "DGtal/base/Common.h"
48 
49 namespace DGtal
50 {
51 
53  // template class TwoStepLocalLengthEstimator
64  template <typename TConstIterator>
66  {
67  // ----------------------- Standard services ------------------------------
68  public:
69 
70 
72  typedef TConstIterator ConstIterator;
73 
74  typedef double Quantity;
75 
76 
80  TwoStepLocalLengthEstimator(const double wdirect, const double wdiag):
81  myWeightDirect(wdirect), myWeightDiagonal(wdiag)
82  {}
83 
84 
89 
90 
91  // ----------------------- Interface --------------------------------------
92  public:
93 
102  void init( const double h, const ConstIterator& itb,
103  const ConstIterator& ite,
104  const bool& isClosed);
105 
106 
114  Quantity eval( ) const;
115 
116 
121  void selfDisplay ( std::ostream & out ) const;
122 
127  bool isValid() const;
128 
129  // ------------------------- Private Datas --------------------------------
130  private:
131 
133  double myH;
134 
138 
141 
145 
146 
147  private:
148 
155 
163 
164  // ------------------------- Internals ------------------------------------
165  private:
166 
167  }; // end of class TwoStepLocalLengthEstimator
168 
169 
176  template <typename T>
177  std::ostream&
178  operator<< ( std::ostream & out, const TwoStepLocalLengthEstimator<T> & object );
179 
180 } // namespace DGtal
181 
182 
184 // Includes inline functions.
185 #include "DGtal/geometry/curves/estimation/TwoStepLocalLengthEstimator.ih"
186 
187 // //
189 
190 #endif // !defined TwoStepLocalLengthEstimator_h
191 
192 #undef TwoStepLocalLengthEstimator_RECURSES
193 #endif // else defined(TwoStepLocalLengthEstimator_RECURSES)
MyDigitalSurface::ConstIterator ConstIterator
Aim: a simple model of CGlobalCurveEstimator that compute the length of a curve using the l_1 metric ...
void selfDisplay(std::ostream &out) const
ConstIterator myBeginIt
Copy of the range.
bool myIsInitBefore
Boolean to make sure that init() has been called before eval().
TwoStepLocalLengthEstimator(const double wdirect, const double wdiag)
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal is the top-level namespace which contains all DGtal functions and types.
TwoStepLocalLengthEstimator & operator=(const TwoStepLocalLengthEstimator &other)
void init(const double h, const ConstIterator &itb, const ConstIterator &ite, const bool &isClosed)