38 #include "DGtal/base/Common.h"
39 #include "DGtal/helpers/StdDefs.h"
40 #include "ConfigExamples.h"
45 #include "DGtal/shapes/Shapes.h"
46 #include "DGtal/shapes/ShapeFactory.h"
47 #include "DGtal/shapes/GaussDigitizer.h"
52 #include "DGtal/topology/helpers/Surfaces.h"
53 #include "DGtal/geometry/curves/GridCurve.h"
58 #include "DGtal/geometry/curves/estimation/TrueGlobalEstimatorOnPoints.h"
59 #include "DGtal/geometry/curves/estimation/ParametricShapeArcLengthFunctor.h"
61 #include "DGtal/geometry/curves/estimation/DSSLengthEstimator.h"
64 #include "DGtal/io/boards/Board2D.h"
68 using namespace DGtal;
98 std::vector<Z2i::Point> boundaryPoints;
110 aBoard.
saveEPS(
"DisplayGridCurve1.eps");
115 Range r = c.getPointsRange();
121 DSSlength.
init( h, r.
c(), r.
c() );
122 double length1 = DSSlength.
eval();
123 trace.
info() <<
"Length (h=" << h <<
"): " << length1 << std::endl;
132 Length > trueLengthEstimator;
133 trueLengthEstimator.init( h, r.
begin(), r.
end(), &flower, c.isClosed());
134 double trueLength = trueLengthEstimator.eval();
135 trace.
info() <<
"ground truth: " << trueLength << std::endl;
151 c.initFromVector( boundaryPoints );
152 Range r2 = c.getPointsRange();
154 DSSlength.
init( h, r2.
c(), r2.
c() );
155 double length2 = DSSlength.
eval();
156 trace.
info() <<
"Length (h=" << h <<
"): " << length2 << std::endl;
161 aBoard.
saveEPS(
"DisplayGridCurve01.eps");
const Point & getUpperBound() const
Aim: A utility class for constructing surfaces (i.e. set of (n-1)-cells).
void attach(ConstAlias< EuclideanShape > shape)
Aim: Represent adjacencies between surfel elements, telling if it follows an interior to exterior ord...
static SCell findABel(const KSpace &K, const PointPredicate &pp, unsigned int nbtries=1000)
Aim: Model of the concept StarShaped represents any flower with k-petals in the plane.
Aim: model of CBidirectionalRangeFromPoint that adapts any range of elements bounded by two iterators...
bool initFromVector(const std::vector< Point > &aVectorOfPoints)
void init(const RealPoint &xLow, const RealPoint &xUp, typename RealVector::Component gridStep)
Aim: implements a functor that estimates the arc length of a paramtric curve.
bool init(const Point &lower, const Point &upper, bool isClosed)
Aim: A class for computing the Gauss digitization of some Euclidean shape, i.e. its intersection with...
void init(const double h, const ConstIterator &itb, const ConstIterator &ite)
void clear(const DGtal::Color &color=DGtal::Color::None)
Aim: a model of CGlobalCurveEstimator that segments the digital curve into DSS and computes the lengt...
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: model of CConstBidirectionalRange that adapts any range of elements bounded by two iterators [it...
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value...
const Point & getLowerBound() const
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
TConstIterator ConstIterator
Aim: describes, in a cellular space of dimension n, a closed or open sequence of signed d-cells (or d...
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex...
Aim: Computes the true quantity to each element of a range associated to a parametric shape...
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)...