DGtal  1.4.beta
SegmentComputerEstimators.h
1 
17 #pragma once
18 
36 #if defined(SegmentComputerEstimators_RECURSES)
37 #error Recursive header files inclusion detected in SegmentComputerEstimators.h
38 #else // defined(SegmentComputerEstimators_RECURSES)
39 
40 #define SegmentComputerEstimators_RECURSES
41 
42 #if !defined SegmentComputerEstimators_h
43 
44 #define SegmentComputerEstimators_h
45 
47 // Inclusions
48 #include <cmath>
49 #include "DGtal/base/Common.h"
50 #include "DGtal/helpers/StdDefs.h"
51 #include "boost/utility.hpp"
52 
54 
55 
56 namespace DGtal
57 {
58 
62  namespace detail
63  {
65  // class PosIndepScaleIndepSCEstimator
67 
83  template <typename TSegmentComputer, typename Functor,
84  typename ReturnType = typename Functor::Value>
86  {
87 
88  public:
89 
90  // ----------------------- inner type ------------------------------
91  typedef TSegmentComputer SegmentComputer;
93  typedef ReturnType Quantity;
94 
95  // ----------------------- Internal data ------------------------------
96  public:
113 
114  // ----------------------- Standard services ------------------------------
115  public:
116 
121  bool isValid() const
122  {
123  return (mySCPtr != 0);
124  };
125 
126  // ----------------------- Interface --------------------------------------
127  public:
128 
133 
140  void init(const double /*h*/, const ConstIterator& itb, const ConstIterator& ite)
141  {
142  myBegin = itb;
143  myEnd = ite;
144  }
145 
150  void attach(const SegmentComputer& aSC)
151  {
152  mySCPtr = &aSC;
153  };
154 
159  Quantity eval(const ConstIterator& /*it*/) const
160  {
161  ASSERT( mySCPtr );
162  return myFunctor( *mySCPtr );
163  }
164 
174  template <typename OutputIterator>
175  OutputIterator eval(const ConstIterator& itb, const ConstIterator& ite,
176  OutputIterator result) const
177  {
178  ASSERT( mySCPtr );
179 
180  // do-while loop to deal with the case of a whole circular range
181  if (isNotEmpty(itb, ite))
182  {
183  ConstIterator it = itb;
184  do
185  {
186  *result++ = myFunctor( *mySCPtr );
187  ++it;
188  } while (it != ite);
189  }
190 
191  return result;
192  }
193 
194  }; // end of class PosIndepScaleIndepSCEstimator
195 
197  // class PosIndepScaleDepSCEstimator
199 
215  template <typename TSegmentComputer, typename Functor,
216  typename ReturnType = typename Functor::Value>
218  {
219 
220  public:
221 
222  // ----------------------- inner type ------------------------------
223  typedef TSegmentComputer SegmentComputer;
225  typedef ReturnType Quantity;
226 
227  // ----------------------- internal data ------------------------------
228  public:
232  double myH;
249 
250  // ----------------------- Standard services ------------------------------
251  public:
252 
258  : myH( 0.0 ), myBegin(), myEnd(), mySCPtr(0), myFunctor()
259  {
260  }
266  : myH( other.myH ), myBegin( other.myBegin ), myEnd( other.myEnd ),
267  mySCPtr( other.mySCPtr ), myFunctor( other.myFunctor )
268  {
269  }
275  {
276  if (this != &other)
277  {
278  myH = other.myH;
279  myBegin = other.myBegin;
280  myEnd = other.myEnd;
281  mySCPtr = other.mySCPtr;
282  myFunctor = other.myFunctor;
283  }
284  return *this;
285  }
290 
295  bool isValid() const
296  {
297  return (myH > 0)&&(mySCPtr != 0);
298  };
299 
300 
301 
302  // ----------------------- Interface --------------------------------------
303  public:
304 
311  void init(const double h, const ConstIterator& itb, const ConstIterator& ite)
312  {
313  myH = h;
314  myBegin = itb;
315  myEnd = ite;
316  ASSERT( myH > 0 );
317  }
318 
323  void attach(const SegmentComputer& aSC)
324  {
325  mySCPtr = &aSC;
326  ASSERT( mySCPtr );
327  };
328 
333  Quantity eval(const ConstIterator& /*it*/) const
334  {
335  ASSERT( isValid() );
336  return myFunctor( *mySCPtr, myH );
337  }
338 
348  template <typename OutputIterator>
349  OutputIterator eval(const ConstIterator& itb, const ConstIterator& ite,
350  OutputIterator result) const
351  {
352  ASSERT( isValid() );
353 
354  // do-while loop to deal with the case of a whole circular range
355  if (isNotEmpty(itb, ite))
356  {
357  ConstIterator it = itb;
358  do
359  {
360  *result++ = myFunctor( *mySCPtr, myH );
361  ++it;
362  } while (it != ite);
363  }
364  return result;
365  }
366 
367  }; // end of class PosIndepScaleDepSCEstimator
368 
370  // class PosDepScaleIndepSCEstimator
372 
387  template <typename TSegmentComputer, typename Functor,
388  typename ReturnType = typename Functor::Value>
390  {
391 
392  public:
393 
394  // ----------------------- inner type ------------------------------
395  typedef TSegmentComputer SegmentComputer;
397  typedef ReturnType Quantity;
398 
399  // ----------------------- Internal data ------------------------------
400  public:
417 
418  // ----------------------- Standard services ------------------------------
419  public:
420 
425  bool isValid() const
426  {
427  return (mySCPtr != 0);
428  };
429 
430  // ----------------------- Interface --------------------------------------
431  public:
432 
437 
443  void init(const double /*h*/, const ConstIterator& itb, const ConstIterator& ite)
444  {
445  myBegin = itb;
446  myEnd = ite;
447  }
448 
453  void attach(const SegmentComputer& aSC)
454  {
455  mySCPtr = &aSC;
456  };
457 
463  Quantity eval(const ConstIterator& it) const
464  {
465  ASSERT( mySCPtr );
466  return myFunctor( it, *mySCPtr );
467  }
468 
478  template <typename OutputIterator>
479  OutputIterator eval(const ConstIterator& itb, const ConstIterator& ite,
480  OutputIterator result) const
481  {
482  ASSERT( mySCPtr );
483 
484  // do-while loop to deal with the case of a whole circular range
485  if (isNotEmpty(itb, ite))
486  {
487  ConstIterator it = itb;
488  do
489  {
490  *result++ = myFunctor( it, *mySCPtr );
491  ++it;
492  } while (it != ite);
493  }
494 
495  return result;
496  }
497 
498  }; // end of class PosDepScaleIndepSCEstimator
499 
501  // class PosDepScaleDepSCEstimator
503 
518  template <typename TSegmentComputer, typename Functor,
519  typename ReturnType = typename Functor::Value>
521  {
522 
523  public:
524 
525  // ----------------------- inner type ------------------------------
526  typedef TSegmentComputer SegmentComputer;
528  typedef ReturnType Quantity;
529 
530  // ----------------------- internal data ------------------------------
531  public:
535  double myH;
552 
553  // ----------------------- Standard services ------------------------------
554  public:
555 
561  : myH( 0.0 ), myBegin(), myEnd(), mySCPtr(0), myFunctor()
562  {
563  }
569  : myH( other.myH ), myBegin( other.myBegin ), myEnd( other.myEnd ),
570  mySCPtr( other.mySCPtr ), myFunctor( other.myFunctor )
571  {
572  }
578  {
579  if (this != &other)
580  {
581  myH = other.myH;
582  myBegin = other.myBegin;
583  myEnd = other.myEnd;
584  mySCPtr = other.mySCPtr;
585  myFunctor = other.myFunctor;
586  }
587  return *this;
588  }
593 
598  bool isValid() const
599  {
600  return (myH > 0)&&(mySCPtr != 0);
601  };
602 
603 
604 
605  // ----------------------- Interface --------------------------------------
606  public:
607 
614  void init(const double h, const ConstIterator& itb, const ConstIterator& ite)
615  {
616  myH = h;
617  myBegin = itb;
618  myEnd = ite;
619  ASSERT( myH > 0 );
620  }
621 
626  void attach(const SegmentComputer& aSC)
627  {
628  mySCPtr = &aSC;
629  ASSERT( mySCPtr );
630  };
631 
637  Quantity eval(const ConstIterator& it) const
638  {
639  ASSERT( isValid() );
640  return myFunctor( it, *mySCPtr, myH );
641  }
642 
652  template <typename OutputIterator>
653  OutputIterator eval(const ConstIterator& itb, const ConstIterator& ite,
654  OutputIterator result) const
655  {
656  ASSERT( isValid() );
657 
658  // do-while loop to deal with the case of a whole circular range
659  if (isNotEmpty(itb, ite))
660  {
661  ConstIterator it = itb;
662  do
663  {
664  *result++ = myFunctor( it, *mySCPtr, myH );
665  ++it;
666  } while (it != ite);
667  }
668 
669  return result;
670  }
671 
672  }; // end of class PosDepScaleDepSCEstimator
673 
676 
682  {
683  public:
684  typedef double Value;
685 
686 
700  template<typename DSS>
701  Value operator() (const DSS& aDSS) const
702  {
704  ::castToDouble(aDSS.a());
706  ::castToDouble(aDSS.b());
707 
708  return std::atan2(a,b);
709  }
710  };
716  {
717  public:
719  typedef RealVector Value;
720 
733  template<typename DSS>
734  Value operator() (const DSS& aDSS) const
735  {
737  ::castToDouble( aDSS.b() );
739  ::castToDouble( aDSS.a() );
740  RealVector v(x,y);
741  double norm = v.norm(RealVector::L_2);
742  v /= norm;
743  return v;
744  }
745  };
750  template<typename DSS>
752  {
753  public:
754  typedef typename DSS::Vector Value;
755 
765  Value operator() (const DSS& aDSS) const
766  {
767  return Value(aDSS.b(), aDSS.a());
768  }
769  };
782  template<bool isCCW = true>
784  {
785  public:
786  typedef double Value;
787 
801  template<typename DCA>
802  Value operator() (const DCA& aDCA, const double& aH = 1.0) const
803  {
804  if ( aDCA.isStraight() )
805  return 0.0;
806  else
807  return ( aDCA.getSeparatingCircle().getCurvature() / aH );
808  }
809  };
810  template<>
811  struct CurvatureFromDCA<false>
812  {
813  public:
814  typedef double Value;
815 
816  template<typename DCA>
817  Value operator() (const DCA& aDCA, const Value& aH = 1.0) const
818  {
819  if ( aDCA.isStraight() )
820  return 0.0;
821  else
822  return - ( aDCA.getSeparatingCircle().getCurvature() / aH );
823  }
824  };
830  {
831  public:
833 
834 
848  template<typename DCA>
849  Value operator() (const typename DCA::ConstIterator& it,
850  const DCA& aDCA) const
851  {
852  typedef typename DCA::Pair Pair;
853  typedef typename DCA::Point Point;
854  typedef typename Point::Coordinate Coordinate;
855 
856  if ( !aDCA.isStraight() )
857  {
858  //separating circle center
859  double c0, c1, r;
860  aDCA.getSeparatingCircle().getParameters(c0, c1, r);
861  //point
862  Pair pair = *it;
863  Point i = pair.first;
864  Point o = pair.second;
865  double m0 = NumberTraits<Coordinate>::castToDouble(i[0]+o[0]) / 2.0;
866  double m1 = NumberTraits<Coordinate>::castToDouble(i[1]+o[1]) / 2.0;
867  //normal vector
868  double v0 = m0 - c0;
869  double v1 = m1 - c1;
870  //norm
871  double n = std::sqrt(v0*v0 + v1*v1);
872  return Value( v0/n, v1/n );
873  }
874  else
875  {
876  //separating straight line and normal vector
877  double a, b, c;
878  aDCA.getStabbingLineComputerPtr()->getParameters(a, b, c);
879  //norm
880  double n = std::sqrt(a*a + b*b);
881  return Value( a/n, b/n );
882  }
883  }
884  };
885 
891  {
892  public:
894 
910  template<typename DCA>
911  Value operator() (const typename DCA::ConstIterator& it,
912  const DCA& aDCA) const
913  {
915  Value normal = f(it, aDCA);
916  return Value( normal[1], normal[0] );
917  }
918  };
919 
926  {
927  public:
928  typedef std::pair<double,double> Value;
929 
946  template<typename DCA>
947  Value operator() (const typename DCA::ConstIterator& it,
948  const DCA& aDCA, const double& aH) const
949  {
950  typedef typename DCA::Pair Pair;
951  typedef typename DCA::Point Point;
952  typedef typename Point::Coordinate Coordinate;
953 
954  if ( !aDCA.isStraight() )
955  {
956  //separating circle center
957  double c0, c1, r;
958  aDCA.getSeparatingCircle().getParameters(c0, c1, r);
959  //points
960  Pair pair = *it;
961  Point i = pair.first;
962  Point o = pair.second;
963  //distances
964  double distI0 = NumberTraits<Coordinate>::castToDouble(i[0]) - c0;
965  double distI1 = NumberTraits<Coordinate>::castToDouble(i[1]) - c1;
966  double distI = std::sqrt( distI0*distI0 + distI1*distI1 ) - r;
967  double distO0 = NumberTraits<Coordinate>::castToDouble(o[0]) - c0;
968  double distO1 = NumberTraits<Coordinate>::castToDouble(o[1]) - c1;
969  double distO = std::sqrt( distO0*distO0 + distO1*distO1 ) - r;
970  return Value( distI*aH, distO*aH );
971  }
972  else
973  {
974  //separating straight line
975  double a, b, c;
976  aDCA.getStabbingLineComputerPtr()->getParameters(a, b, c);
977  //norm
978  double n = std::sqrt(a*a + b*b);
979  //points
980  Pair pair = *it;
981  Point i = pair.first;
982  Point o = pair.second;
983  //distances
984  double rI = NumberTraits<Coordinate>::castToDouble(i[0])*a +
986  double distI = rI / n;
987  double rO = NumberTraits<Coordinate>::castToDouble(o[0])*a +
989  double distO = rO / n;
990  return Value( distI*aH, distO*aH );
991  }
992  }
993  };
994 
995  }//namespace detail
996 
997 
998 
999  //-------------------------------------------------------------------------------------------
1008  template <typename DSSComputer>
1010  public detail::PosIndepScaleIndepSCEstimator<DSSComputer, detail::NormalizedTangentVectorFromDSS>
1011  {
1012  typedef
1015 
1016  public:
1026  };
1027 
1028  //-------------------------------------------------------------------------------------------
1037  template <typename DSSComputer>
1039  public detail::PosIndepScaleIndepSCEstimator<DSSComputer, detail::TangentVectorFromDSS<DSSComputer> >
1040  {
1041  typedef
1044 
1045  public:
1055  };
1056 
1057  //-------------------------------------------------------------------------------------------
1067  template <typename DSSComputer>
1069  public detail::PosIndepScaleIndepSCEstimator<DSSComputer, detail::TangentAngleFromDSS>
1070  {
1071  typedef
1074 
1075  public:
1085  };
1086 
1087  //-------------------------------------------------------------------------------------------
1105  template <typename DCAComputer, bool isCCW = true>
1107  public detail::PosIndepScaleDepSCEstimator<DCAComputer,
1108  detail::CurvatureFromDCA<isCCW> >
1109  {
1110  typedef
1113 
1114  public:
1124  };
1125 
1126  //-------------------------------------------------------------------------------------------
1135  template <typename DCAComputer>
1137  public detail::PosDepScaleIndepSCEstimator<DCAComputer,
1138  detail::NormalVectorFromDCA>
1139  {
1140  typedef
1143 
1144  public:
1154  };
1155 
1156  //-------------------------------------------------------------------------------------------
1165  template <typename DCAComputer>
1167  public detail::PosDepScaleIndepSCEstimator<DCAComputer,
1168  detail::TangentVectorFromDCA>
1169  {
1170  typedef
1173 
1174  public:
1184  };
1185 
1186  //-------------------------------------------------------------------------------------------
1196  template <typename DCAComputer>
1198  public detail::PosDepScaleDepSCEstimator<DCAComputer,
1199  detail::DistanceFromDCA>
1200  {
1201  typedef
1204 
1205  public:
1215  };
1216 
1220  namespace detail
1221  {
1234  {
1235  public:
1236  typedef double Value;
1237 
1238  template<typename DSS>
1239  Value operator() (const DSS& aDSS) const
1240  {
1241  typedef typename DSS::Vector Vector;
1242  //length
1243  Vector v = ( *aDSS.begin() - *boost::prior(aDSS.end()) );
1244  Value l = v.norm(Vector::L_2);
1245  //result
1246  return 1./( (l*l)/8. + 0.5 );
1247  }
1248  };
1249 
1262  {
1263  public:
1264  typedef double Value;
1265 
1266  template<typename DSS>
1267  Value operator() (const DSS& aDSS) const
1268  {
1269  typedef typename DSS::Vector Vector;
1270  //length
1271  Vector v = ( *aDSS.begin() - *boost::prior(aDSS.end()) );
1272  Value l = v.norm(Vector::L_2);
1273  //width
1274  Vector t( aDSS.b(), aDSS.a() );
1275  Value w = 1.0 / v.norm(Vector::L_2);
1276  //result
1277  return 1.0/( (l*l)/(8.*w) + w/2 );
1278  }
1279  };
1280 
1282  // class CurvatureFromDSSBaseEstimator
1284 
1299  template <typename DSSComputer, typename Functor = detail::CurvatureFromDSSLength >
1301  {
1302 
1303  public:
1304 
1305  // ----------------------- inner type ------------------------------------
1306  typedef DSSComputer SegmentComputer;
1308  typedef double Quantity;
1309 
1311 
1312  // ----------------------- internal data ------------------------------
1313  public:
1317  double myH;
1334 
1335  // ----------------------- Standard services ------------------------------
1336  public:
1337 
1343  : myH( 0.0 ), myBegin(), myEnd(), mySCPtr(0), myFunctor()
1344  {
1345  }
1351  : myH( other.myH ), myBegin( other.myBegin ), myEnd( other.myEnd ),
1352  mySCPtr( other.mySCPtr ), myFunctor( other.myFunctor )
1353  {
1354  }
1360  {
1361  if (this != &other)
1362  {
1363  myH = other.myH;
1364  myBegin = other.myBegin;
1365  myEnd = other.myEnd;
1366  mySCPtr = other.mySCPtr;
1367  myFunctor = other.myFunctor;
1368  }
1369  return *this;
1370  }
1375 
1380  bool isValid() const
1381  {
1382  return (myH > 0)&&(mySCPtr != 0);
1383  };
1384 
1385  // ----------------------- Interface --------------------------------------
1386  public:
1387 
1394  void init(const double h, const ConstIterator& itb, const ConstIterator& ite)
1395  {
1396  myH = h;
1397  myBegin = itb;
1398  myEnd = ite;
1399  ASSERT( myH > 0 );
1400  }
1401 
1406  Quantity eval(const ConstIterator& /*it*/)
1407  {
1408  ASSERT( isValid() );
1409 
1410  //types
1411  typedef typename DSSComputer::Integer Integer;
1412  typedef typename DSSComputer::Vector Vector;
1413 
1414  //curvature value
1415  Quantity k = 0;
1416 
1417  //begin and end iterators
1418  //(back point on the first point)
1419  //(front point on the last point)
1420  ConstIterator back = mySCPtr->begin();
1421  ConstIterator front = mySCPtr->end();
1422  bool isConnectedAtBack = isNotEmpty(myBegin, back)
1423  &&((*boost::prior(back)-*back).norm(Vector::L_1) <= NumberTraits<Integer>::ONE);
1424  bool isConnectedAtFront = isNotEmpty(front, myEnd)
1425  &&((*boost::prior(front)-*front).norm(Vector::L_1) <= NumberTraits<Integer>::ONE);
1426 
1427  Integer mu = mySCPtr->mu();
1428  Integer omega = mySCPtr->omega();
1429  if (isConnectedAtBack)
1430  {
1431  --back;
1432  //parameters
1433  if (isConnectedAtFront)
1434  {
1435  if ((mySCPtr->remainder(*back)<=mu-1)&&
1436  (mySCPtr->remainder(*front)<=mu-1) )
1437  {
1438  //convex
1439  k = myFunctor(*mySCPtr) / myH;
1440  }
1441  else if ( (mySCPtr->remainder(*back)>=mu+omega)&&
1442  (mySCPtr->remainder(*front)>=mu+omega) )
1443  {
1444  //concave
1445  k = -myFunctor(*mySCPtr) / myH;
1446  } //else inflection
1447  }
1448  else
1449  {
1450  if ( (mySCPtr->remainder(*back)<=mu-1) )
1451  {
1452  //convex
1453  k = myFunctor(*mySCPtr) / myH;
1454  }
1455  else if ( (mySCPtr->remainder(*back)>=mu+omega) )
1456  {
1457  //concave
1458  k = -myFunctor(*mySCPtr) / myH;
1459  } //else inflection
1460  }
1461  }
1462  else if (isConnectedAtFront)
1463  {
1464  if ( (mySCPtr->remainder(*front)<=mu-1) )
1465  {
1466  //convex
1467  k = myFunctor(*mySCPtr) / myH;
1468  }
1469  else if ( (mySCPtr->remainder(*front)>=mu+omega) )
1470  {
1471  //concave
1472  k = -myFunctor(*mySCPtr) / myH;
1473  } //else inflection
1474  } //else cannot be extended: k is set to 0
1475 
1476  return k;
1477  }
1478 
1488  template <typename OutputIterator>
1489  OutputIterator eval(const ConstIterator& itb, const ConstIterator& ite,
1490  OutputIterator result)
1491  {
1492  ASSERT( isValid() );
1493 
1494  // do-while loop to deal with the case of a whole circular range
1495  if (isNotEmpty(itb, ite))
1496  {
1497  ConstIterator it = itb;
1498  do
1499  {
1500  *result++ = eval( it );
1501  ++it;
1502  } while (it != ite);
1503  }
1504 
1505  return result;
1506  }
1507 
1512  void attach(const SegmentComputer& aSC)
1513  {
1514  mySCPtr = &aSC;
1515  ASSERT( mySCPtr );
1516  };
1517 
1518 
1519  }; // end of class CurvatureFromDSSBaseEstimator
1520 
1521  }//namespace detail
1522 
1523 
1524 
1525  //-------------------------------------------------------------------------------------------
1547  template <typename DSSComputer>
1549  public detail::CurvatureFromDSSBaseEstimator<DSSComputer, detail::CurvatureFromDSSLength >
1550  {
1551 
1553 
1554  public:
1564  };
1565 
1566  //-------------------------------------------------------------------------------------------
1584  template <typename DSSComputer>
1586  public detail::CurvatureFromDSSBaseEstimator<DSSComputer, detail::CurvatureFromDSSLengthAndWidth >
1587  {
1588 
1590 
1591  public:
1601  };
1602 
1603 
1604 } // namespace DGtal
1605 
1606 // //
1608 
1609 #endif // !defined SegmentComputerEstimators_h
1610 
1611 #undef SegmentComputerEstimators_RECURSES
1612 #endif // else defined(SegmentComputerEstimators_RECURSES)
DGtal::detail::PosIndepScaleDepSCEstimator::eval
Quantity eval(const ConstIterator &) const
Definition: SegmentComputerEstimators.h:333
DGtal::detail::NormalVectorFromDCA::Value
PointVector< 2, double > Value
Definition: SegmentComputerEstimators.h:832
DGtal::detail::CurvatureFromDSSBaseEstimator::operator=
CurvatureFromDSSBaseEstimator & operator=(const CurvatureFromDSSBaseEstimator &other)
Definition: SegmentComputerEstimators.h:1359
DGtal::detail::CurvatureFromDSSBaseEstimator
Definition: SegmentComputerEstimators.h:1300
ConstIterator
MyDigitalSurface::ConstIterator ConstIterator
Definition: greedy-plane-segmentation-ex2.cpp:93
DGtal::TangentAngleFromDSSEstimator::Super
detail::PosIndepScaleIndepSCEstimator< DSSComputer, detail::TangentAngleFromDSS > Super
Definition: SegmentComputerEstimators.h:1073
DGtal::detail::CurvatureFromDSSBaseEstimator::myFunctor
Functor myFunctor
Definition: SegmentComputerEstimators.h:1333
DGtal::detail::NormalizedTangentVectorFromDSS::Value
RealVector Value
Definition: SegmentComputerEstimators.h:719
DGtal::detail::CurvatureFromDSSBaseEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< Functor, SegmentComputer, Quantity >))
DGtal::detail::PosIndepScaleIndepSCEstimator::SegmentComputer
TSegmentComputer SegmentComputer
Definition: SegmentComputerEstimators.h:91
DGtal::detail::PosIndepScaleIndepSCEstimator::ConstIterator
SegmentComputer::ConstIterator ConstIterator
Definition: SegmentComputerEstimators.h:92
DGtal::TangentFromDCAEstimator::Super
detail::PosDepScaleIndepSCEstimator< DCAComputer, detail::TangentVectorFromDCA > Super
Definition: SegmentComputerEstimators.h:1172
DGtal::detail::PosDepScaleDepSCEstimator::myEnd
ConstIterator myEnd
Definition: SegmentComputerEstimators.h:543
DGtal::detail::PosIndepScaleDepSCEstimator::myBegin
ConstIterator myBegin
Definition: SegmentComputerEstimators.h:236
DGtal::CurvatureFromDSSEstimator::CurvatureFromDSSEstimator
CurvatureFromDSSEstimator()
Definition: SegmentComputerEstimators.h:1595
DGtal::detail::PosDepScaleIndepSCEstimator::myBegin
ConstIterator myBegin
Definition: SegmentComputerEstimators.h:404
DGtal::detail::PosIndepScaleIndepSCEstimator::init
void init(const double, const ConstIterator &itb, const ConstIterator &ite)
Definition: SegmentComputerEstimators.h:140
DGtal::detail::PosDepScaleIndepSCEstimator::init
void init(const double, const ConstIterator &itb, const ConstIterator &ite)
Definition: SegmentComputerEstimators.h:443
DGtal::TangentVectorFromDSSEstimator::TangentVectorFromDSSEstimator
TangentVectorFromDSSEstimator()
Definition: SegmentComputerEstimators.h:1049
DGtal::detail::PosIndepScaleIndepSCEstimator::myEnd
ConstIterator myEnd
Definition: SegmentComputerEstimators.h:104
DGtal::NormalFromDCAEstimator::NormalFromDCAEstimator
NormalFromDCAEstimator(const NormalFromDCAEstimator &other)
Definition: SegmentComputerEstimators.h:1153
DGtal::CurvatureFromDSSLengthEstimator
Definition: SegmentComputerEstimators.h:1548
DGtal::detail::CurvatureFromDSSBaseEstimator::myBegin
ConstIterator myBegin
Definition: SegmentComputerEstimators.h:1321
DGtal::NumberTraits
Aim: The traits class for all models of Cinteger.
Definition: NumberTraits.h:562
SegmentComputer
ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 > SegmentComputer
Definition: testArithmeticalDSSComputerOnSurfels.cpp:55
DGtal::TangentAngleFromDSSEstimator
Definition: SegmentComputerEstimators.h:1068
DGtal::detail::PosDepScaleIndepSCEstimator::isValid
bool isValid() const
Definition: SegmentComputerEstimators.h:425
DGtal::CurvatureFromDCAEstimator::Super
detail::PosIndepScaleDepSCEstimator< DCAComputer, detail::CurvatureFromDCA< isCCW > > Super
Definition: SegmentComputerEstimators.h:1112
DGtal::detail::PosDepScaleDepSCEstimator::eval
OutputIterator eval(const ConstIterator &itb, const ConstIterator &ite, OutputIterator result) const
Definition: SegmentComputerEstimators.h:653
DGtal::detail::PosDepScaleDepSCEstimator::eval
Quantity eval(const ConstIterator &it) const
Definition: SegmentComputerEstimators.h:637
DGtal::detail::CurvatureFromDSSBaseEstimator::isValid
bool isValid() const
Definition: SegmentComputerEstimators.h:1380
DGtal::detail::CurvatureFromDSSBaseEstimator::myH
double myH
Definition: SegmentComputerEstimators.h:1317
DGtal::TangentVectorFromDSSEstimator::TangentVectorFromDSSEstimator
TangentVectorFromDSSEstimator(const TangentVectorFromDSSEstimator &other)
Definition: SegmentComputerEstimators.h:1054
DGtal::detail::PosIndepScaleIndepSCEstimator::eval
Quantity eval(const ConstIterator &) const
Definition: SegmentComputerEstimators.h:159
DGtal::detail::PosDepScaleIndepSCEstimator::eval
OutputIterator eval(const ConstIterator &itb, const ConstIterator &ite, OutputIterator result) const
Definition: SegmentComputerEstimators.h:479
DGtal::detail::PosIndepScaleDepSCEstimator::~PosIndepScaleDepSCEstimator
~PosIndepScaleDepSCEstimator()
Definition: SegmentComputerEstimators.h:289
DGtal::detail::PosIndepScaleDepSCEstimator::attach
void attach(const SegmentComputer &aSC)
Definition: SegmentComputerEstimators.h:323
DGtal::detail::CurvatureFromDSSBaseEstimator::myEnd
ConstIterator myEnd
Definition: SegmentComputerEstimators.h:1325
DGtal::detail::PosDepScaleDepSCEstimator::init
void init(const double h, const ConstIterator &itb, const ConstIterator &ite)
Definition: SegmentComputerEstimators.h:614
DGtal::detail::PosIndepScaleDepSCEstimator::isValid
bool isValid() const
Definition: SegmentComputerEstimators.h:295
DGtal::detail::PosDepScaleIndepSCEstimator::PosDepScaleIndepSCEstimator
PosDepScaleIndepSCEstimator()
Definition: SegmentComputerEstimators.h:436
DGtal::PointVector< 2, double >::L_2
@ L_2
Definition: PointVector.h:1493
DGtal::detail::PosDepScaleIndepSCEstimator::myEnd
ConstIterator myEnd
Definition: SegmentComputerEstimators.h:408
DGtal::detail::CurvatureFromDSSLengthAndWidth::Value
double Value
Definition: SegmentComputerEstimators.h:1264
Functor
InHalfPlaneBySimple3x3Matrix< Point, double > Functor
Definition: testConvexHull2DReverse.cpp:51
DGtal::detail::NormalVectorFromDCA
Definition: SegmentComputerEstimators.h:829
DGtal::detail::CurvatureFromDCA< false >::Value
double Value
Definition: SegmentComputerEstimators.h:814
DGtal::detail::PosDepScaleDepSCEstimator::myBegin
ConstIterator myBegin
Definition: SegmentComputerEstimators.h:539
DGtal::detail::PosDepScaleDepSCEstimator::myH
double myH
Definition: SegmentComputerEstimators.h:535
DGtal::detail::PosDepScaleDepSCEstimator::operator=
PosDepScaleDepSCEstimator & operator=(const PosDepScaleDepSCEstimator &other)
Definition: SegmentComputerEstimators.h:577
DGtal::detail::PosDepScaleDepSCEstimator::~PosDepScaleDepSCEstimator
~PosDepScaleDepSCEstimator()
Definition: SegmentComputerEstimators.h:592
DGtal::detail::PosDepScaleIndepSCEstimator::eval
Quantity eval(const ConstIterator &it) const
Definition: SegmentComputerEstimators.h:463
DGtal::detail::CurvatureFromDSSBaseEstimator::attach
void attach(const SegmentComputer &aSC)
Definition: SegmentComputerEstimators.h:1512
DGtal::detail::TangentVectorFromDSS::Value
DSS::Vector Value
Definition: SegmentComputerEstimators.h:754
DGtal::detail::CurvatureFromDSSBaseEstimator::eval
OutputIterator eval(const ConstIterator &itb, const ConstIterator &ite, OutputIterator result)
Definition: SegmentComputerEstimators.h:1489
DGtal::detail::NormalizedTangentVectorFromDSS::RealVector
DGtal::PointVector< 2, double > RealVector
Definition: SegmentComputerEstimators.h:718
DGtal::detail::CurvatureFromDCA
Definition: SegmentComputerEstimators.h:783
DGtal::detail::PosIndepScaleDepSCEstimator::init
void init(const double h, const ConstIterator &itb, const ConstIterator &ite)
Definition: SegmentComputerEstimators.h:311
DGtal::detail::PosIndepScaleDepSCEstimator::PosIndepScaleDepSCEstimator
PosIndepScaleDepSCEstimator()
Definition: SegmentComputerEstimators.h:257
DGtal::detail::DistanceFromDCA::Value
std::pair< double, double > Value
Definition: SegmentComputerEstimators.h:928
DGtal::CurvatureFromDCAEstimator::CurvatureFromDCAEstimator
CurvatureFromDCAEstimator()
Definition: SegmentComputerEstimators.h:1118
DGtal::detail::TangentAngleFromDSS
Definition: SegmentComputerEstimators.h:681
DGtal::detail::PosDepScaleDepSCEstimator::myFunctor
Functor myFunctor
Definition: SegmentComputerEstimators.h:551
DGtal::detail::CurvatureFromDSSLength::Value
double Value
Definition: SegmentComputerEstimators.h:1236
DGtal::detail::CurvatureFromDSSLengthAndWidth
Definition: SegmentComputerEstimators.h:1261
DGtal::detail::TangentVectorFromDSS::operator()
Value operator()(const DSS &aDSS) const
Definition: SegmentComputerEstimators.h:765
DGtal::detail::PosIndepScaleDepSCEstimator::SegmentComputer
TSegmentComputer SegmentComputer
Definition: SegmentComputerEstimators.h:223
DGtal::ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 >::ConstIterator
std::vector< Z2i::Point >::const_iterator ConstIterator
Definition: ArithmeticalDSSComputer.h:95
DGtal::detail::PosDepScaleIndepSCEstimator::ConstIterator
SegmentComputer::ConstIterator ConstIterator
Definition: SegmentComputerEstimators.h:396
DGtal::CurvatureFromDCAEstimator
Definition: SegmentComputerEstimators.h:1106
DGtal::detail::PosDepScaleDepSCEstimator::ConstIterator
SegmentComputer::ConstIterator ConstIterator
Definition: SegmentComputerEstimators.h:527
DGtal::detail::NormalizedTangentVectorFromDSS
Definition: SegmentComputerEstimators.h:715
DGtal::NormalFromDCAEstimator::NormalFromDCAEstimator
NormalFromDCAEstimator()
Definition: SegmentComputerEstimators.h:1148
DGtal::DistanceFromDCAEstimator::DistanceFromDCAEstimator
DistanceFromDCAEstimator(const DistanceFromDCAEstimator &other)
Definition: SegmentComputerEstimators.h:1214
DGtal::TangentFromDCAEstimator
Definition: SegmentComputerEstimators.h:1166
DGtal::detail::CurvatureFromDSSBaseEstimator::CurvatureFromDSSBaseEstimator
CurvatureFromDSSBaseEstimator(const CurvatureFromDSSBaseEstimator &other)
Definition: SegmentComputerEstimators.h:1350
DGtal::detail::PosDepScaleDepSCEstimator::PosDepScaleDepSCEstimator
PosDepScaleDepSCEstimator()
Definition: SegmentComputerEstimators.h:560
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::detail::PosIndepScaleIndepSCEstimator::Quantity
ReturnType Quantity
Definition: SegmentComputerEstimators.h:93
DGtal::TangentFromDCAEstimator::TangentFromDCAEstimator
TangentFromDCAEstimator(const TangentFromDCAEstimator &other)
Definition: SegmentComputerEstimators.h:1183
DGtal::detail::PosIndepScaleDepSCEstimator::Quantity
ReturnType Quantity
Definition: SegmentComputerEstimators.h:225
DGtal::NormalFromDCAEstimator
Definition: SegmentComputerEstimators.h:1136
DGtal::detail::CurvatureFromDSSBaseEstimator::~CurvatureFromDSSBaseEstimator
~CurvatureFromDSSBaseEstimator()
Definition: SegmentComputerEstimators.h:1374
DGtal::detail::PosDepScaleDepSCEstimator::mySCPtr
const SegmentComputer * mySCPtr
Definition: SegmentComputerEstimators.h:547
DGtal::DistanceFromDCAEstimator
Definition: SegmentComputerEstimators.h:1197
DGtal::detail::PosIndepScaleDepSCEstimator::eval
OutputIterator eval(const ConstIterator &itb, const ConstIterator &ite, OutputIterator result) const
Definition: SegmentComputerEstimators.h:349
DGtal::detail::TangentAngleFromDSS::operator()
Value operator()(const DSS &aDSS) const
Definition: SegmentComputerEstimators.h:701
DGtal::detail::TangentVectorFromDCA::operator()
Value operator()(const typename DCA::ConstIterator &it, const DCA &aDCA) const
Definition: SegmentComputerEstimators.h:911
DGtal::detail::PosDepScaleDepSCEstimator::isValid
bool isValid() const
Definition: SegmentComputerEstimators.h:598
DGtal::detail::PosIndepScaleDepSCEstimator::ConstIterator
SegmentComputer::ConstIterator ConstIterator
Definition: SegmentComputerEstimators.h:224
DGtal::detail::PosDepScaleDepSCEstimator::PosDepScaleDepSCEstimator
PosDepScaleDepSCEstimator(const PosDepScaleDepSCEstimator &other)
Definition: SegmentComputerEstimators.h:568
DGtal::detail::PosIndepScaleIndepSCEstimator::myFunctor
Functor myFunctor
Definition: SegmentComputerEstimators.h:112
DGtal::CurvatureFromDSSEstimator
Definition: SegmentComputerEstimators.h:1585
DGtal::CurvatureFromDSSLengthEstimator::CurvatureFromDSSLengthEstimator
CurvatureFromDSSLengthEstimator(const CurvatureFromDSSLengthEstimator &other)
Definition: SegmentComputerEstimators.h:1563
DGtal::TangentAngleFromDSSEstimator::TangentAngleFromDSSEstimator
TangentAngleFromDSSEstimator(const TangentAngleFromDSSEstimator &other)
Definition: SegmentComputerEstimators.h:1084
DGtal::detail::CurvatureFromDSSLength
Definition: SegmentComputerEstimators.h:1233
DGtal::TangentFromDSSEstimator::TangentFromDSSEstimator
TangentFromDSSEstimator(const TangentFromDSSEstimator &other)
Definition: SegmentComputerEstimators.h:1025
DGtal::TangentFromDSSEstimator
Definition: SegmentComputerEstimators.h:1009
DGtal::detail::PosIndepScaleIndepSCEstimator::myBegin
ConstIterator myBegin
Definition: SegmentComputerEstimators.h:100
DGtal::detail::PosDepScaleDepSCEstimator
Definition: SegmentComputerEstimators.h:520
DGtal::detail::PosDepScaleIndepSCEstimator::attach
void attach(const SegmentComputer &aSC)
Definition: SegmentComputerEstimators.h:453
DGtal::detail::CurvatureFromDSSBaseEstimator::CurvatureFromDSSBaseEstimator
CurvatureFromDSSBaseEstimator()
Definition: SegmentComputerEstimators.h:1342
DGtal::detail::PosDepScaleIndepSCEstimator::SegmentComputer
TSegmentComputer SegmentComputer
Definition: SegmentComputerEstimators.h:395
DGtal::TangentFromDSSEstimator::Super
detail::PosIndepScaleIndepSCEstimator< DSSComputer, detail::NormalizedTangentVectorFromDSS > Super
Definition: SegmentComputerEstimators.h:1014
Vector
FreemanChain< int >::Vector Vector
Definition: testCombinDSS.cpp:60
DGtal::detail::CurvatureFromDCA::Value
double Value
Definition: SegmentComputerEstimators.h:786
DGtal::detail::CurvatureFromDSSBaseEstimator::mySCPtr
const SegmentComputer * mySCPtr
Definition: SegmentComputerEstimators.h:1329
DGtal::DistanceFromDCAEstimator::DistanceFromDCAEstimator
DistanceFromDCAEstimator()
Definition: SegmentComputerEstimators.h:1209
Integer
Point::Coordinate Integer
Definition: examplePlaneProbingParallelepipedEstimator.cpp:44
DGtal::TangentAngleFromDSSEstimator::TangentAngleFromDSSEstimator
TangentAngleFromDSSEstimator()
Definition: SegmentComputerEstimators.h:1079
DGtal::detail::DistanceFromDCA::operator()
Value operator()(const typename DCA::ConstIterator &it, const DCA &aDCA, const double &aH) const
Definition: SegmentComputerEstimators.h:947
DGtal::detail::PosDepScaleDepSCEstimator::SegmentComputer
TSegmentComputer SegmentComputer
Definition: SegmentComputerEstimators.h:526
DGtal::detail::CurvatureFromDSSBaseEstimator::init
void init(const double h, const ConstIterator &itb, const ConstIterator &ite)
Definition: SegmentComputerEstimators.h:1394
DGtal::detail::CurvatureFromDCA::operator()
Value operator()(const DCA &aDCA, const double &aH=1.0) const
Definition: SegmentComputerEstimators.h:802
DGtal::detail::PosDepScaleDepSCEstimator::attach
void attach(const SegmentComputer &aSC)
Definition: SegmentComputerEstimators.h:626
DGtal::detail::PosIndepScaleDepSCEstimator
Definition: SegmentComputerEstimators.h:217
DGtal::detail::PosIndepScaleDepSCEstimator::operator=
PosIndepScaleDepSCEstimator & operator=(const PosIndepScaleDepSCEstimator &other)
Definition: SegmentComputerEstimators.h:274
DGtal::detail::PosIndepScaleDepSCEstimator::mySCPtr
const SegmentComputer * mySCPtr
Definition: SegmentComputerEstimators.h:244
DGtal::CurvatureFromDSSLengthEstimator::CurvatureFromDSSLengthEstimator
CurvatureFromDSSLengthEstimator()
Definition: SegmentComputerEstimators.h:1558
DGtal::NumberTraitsImpl< std::decay< T >::type >::castToDouble
static double castToDouble(const std::decay< T >::type &aT)
Cast method to double (for I/O or board export uses only).
Definition: NumberTraits.h:164
DGtal::detail::PosIndepScaleIndepSCEstimator::mySCPtr
const SegmentComputer * mySCPtr
Definition: SegmentComputerEstimators.h:108
DGtal::DistanceFromDCAEstimator::Super
detail::PosDepScaleDepSCEstimator< DCAComputer, detail::DistanceFromDCA > Super
Definition: SegmentComputerEstimators.h:1203
DGtal::NormalFromDCAEstimator::Super
detail::PosDepScaleIndepSCEstimator< DCAComputer, detail::NormalVectorFromDCA > Super
Definition: SegmentComputerEstimators.h:1142
DGtal::detail::isNotEmpty
bool isNotEmpty(const IC &itb, const IC &ite, IteratorType)
DGtal::detail::PosIndepScaleIndepSCEstimator::attach
void attach(const SegmentComputer &aSC)
Definition: SegmentComputerEstimators.h:150
DGtal::PointVector< 2, double >
DGtal::detail::PosIndepScaleDepSCEstimator::myEnd
ConstIterator myEnd
Definition: SegmentComputerEstimators.h:240
DGtal::detail::CurvatureFromDSSBaseEstimator::ConstIterator
DSSComputer::ConstIterator ConstIterator
Definition: SegmentComputerEstimators.h:1307
DGtal::CurvatureFromDCAEstimator::CurvatureFromDCAEstimator
CurvatureFromDCAEstimator(const CurvatureFromDCAEstimator &other)
Definition: SegmentComputerEstimators.h:1123
DGtal::detail::CurvatureFromDSSBaseEstimator::SegmentComputer
DSSComputer SegmentComputer
Definition: SegmentComputerEstimators.h:1306
DGtal::detail::PosIndepScaleDepSCEstimator::myFunctor
Functor myFunctor
Definition: SegmentComputerEstimators.h:248
DGtal::detail::PosIndepScaleDepSCEstimator::PosIndepScaleDepSCEstimator
PosIndepScaleDepSCEstimator(const PosIndepScaleDepSCEstimator &other)
Definition: SegmentComputerEstimators.h:265
DGtal::detail::PosIndepScaleIndepSCEstimator
Definition: SegmentComputerEstimators.h:85
DGtal::CurvatureFromDSSEstimator::CurvatureFromDSSEstimator
CurvatureFromDSSEstimator(const CurvatureFromDSSEstimator &other)
Definition: SegmentComputerEstimators.h:1600
DGtal::detail::PosIndepScaleDepSCEstimator::myH
double myH
Definition: SegmentComputerEstimators.h:232
DGtal::detail::PosDepScaleIndepSCEstimator::mySCPtr
const SegmentComputer * mySCPtr
Definition: SegmentComputerEstimators.h:412
DGtal::detail::CurvatureFromDSSBaseEstimator::Quantity
double Quantity
Definition: SegmentComputerEstimators.h:1308
DGtal::detail::PosIndepScaleIndepSCEstimator::PosIndepScaleIndepSCEstimator
PosIndepScaleIndepSCEstimator()
Definition: SegmentComputerEstimators.h:132
DGtal::detail::PosDepScaleDepSCEstimator::Quantity
ReturnType Quantity
Definition: SegmentComputerEstimators.h:528
DGtal::detail::TangentVectorFromDSS
Definition: SegmentComputerEstimators.h:751
DGtal::TangentVectorFromDSSEstimator::Super
detail::PosIndepScaleIndepSCEstimator< DSSComputer, detail::TangentVectorFromDSS< DSSComputer > > Super
Definition: SegmentComputerEstimators.h:1043
DGtal::detail::PosDepScaleIndepSCEstimator::Quantity
ReturnType Quantity
Definition: SegmentComputerEstimators.h:397
DGtal::CurvatureFromDSSEstimator::Super
detail::CurvatureFromDSSBaseEstimator< DSSComputer, detail::CurvatureFromDSSLengthAndWidth > Super
Definition: SegmentComputerEstimators.h:1589
DGtal::TangentFromDSSEstimator::TangentFromDSSEstimator
TangentFromDSSEstimator()
Definition: SegmentComputerEstimators.h:1020
DGtal::detail::PosDepScaleIndepSCEstimator
Definition: SegmentComputerEstimators.h:389
DGtal::detail::NormalizedTangentVectorFromDSS::operator()
Value operator()(const DSS &aDSS) const
Definition: SegmentComputerEstimators.h:734
DGtal::detail::DistanceFromDCA
Definition: SegmentComputerEstimators.h:925
DGtal::detail::CurvatureFromDSSLength::operator()
Value operator()(const DSS &aDSS) const
Definition: SegmentComputerEstimators.h:1239
DGtal::detail::PosDepScaleIndepSCEstimator::myFunctor
Functor myFunctor
Definition: SegmentComputerEstimators.h:416
Point
MyPointD Point
Definition: testClone2.cpp:383
DGtal::detail::PosIndepScaleIndepSCEstimator::eval
OutputIterator eval(const ConstIterator &itb, const ConstIterator &ite, OutputIterator result) const
Definition: SegmentComputerEstimators.h:175
DGtal::detail::CurvatureFromDSSLengthAndWidth::operator()
Value operator()(const DSS &aDSS) const
Definition: SegmentComputerEstimators.h:1267
DGtal::detail::TangentAngleFromDSS::Value
double Value
Definition: SegmentComputerEstimators.h:684
DGtal::TangentVectorFromDSSEstimator
Definition: SegmentComputerEstimators.h:1038
DGtal::TangentFromDCAEstimator::TangentFromDCAEstimator
TangentFromDCAEstimator()
Definition: SegmentComputerEstimators.h:1178
DGtal::concepts::CUnaryFunctor
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:89
DGtal::CurvatureFromDSSLengthEstimator::Super
detail::CurvatureFromDSSBaseEstimator< DSSComputer, detail::CurvatureFromDSSLength > Super
Definition: SegmentComputerEstimators.h:1552
DGtal::detail::NormalVectorFromDCA::operator()
Value operator()(const typename DCA::ConstIterator &it, const DCA &aDCA) const
Definition: SegmentComputerEstimators.h:849
DGtal::detail::TangentVectorFromDCA::Value
PointVector< 2, double > Value
Definition: SegmentComputerEstimators.h:893
Value
double Value
Definition: testSimpleRandomAccessRangeFromPoint.cpp:38
DGtal::detail::CurvatureFromDSSBaseEstimator::eval
Quantity eval(const ConstIterator &)
Definition: SegmentComputerEstimators.h:1406
DGtal::detail::PosIndepScaleIndepSCEstimator::isValid
bool isValid() const
Definition: SegmentComputerEstimators.h:121
DGtal::detail::TangentVectorFromDCA
Definition: SegmentComputerEstimators.h:890