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"
98 std::vector<Z2i::Point> boundaryPoints;
110 aBoard.
saveEPS(
"DisplayGridCurve1.eps");
115 Range r = c.getPointsRange();
121 double length1 = DSSlength.
eval(r.c(), r.c(), h);
122 trace.
info() <<
"Length (h=" << h <<
"): " << length1 << std::endl;
130 Length > trueLengthEstimator;
131 trueLengthEstimator.attach(flower);
133 double trueLength = trueLengthEstimator.eval();
134 trace.
info() <<
"ground truth: " << trueLength << std::endl;
150 c.initFromVector( boundaryPoints );
151 Range r2 = c.getPointsRange();
153 double length2 = DSSlength.
eval(r2.
c(), r2.
c(), h);
154 trace.
info() <<
"Length (h=" << h <<
"): " << length2 << std::endl;
159 aBoard.
saveEPS(
"DisplayGridCurve01.eps");
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Aim: model of CConstBidirectionalRange that adapts any range of elements bounded by two iterators [it...
Aim: a model of CGlobalCurveEstimator that segments the digital curve into DSS and computes the lengt...
Quantity eval(const ConstIterator &itb, const ConstIterator &ite, const double h=1.) const
Aim: Model of the concept StarShaped represents any flower with k-petals in the plane.
Aim: A class for computing the Gauss digitization of some Euclidean shape, i.e. its intersection with...
const Point & getUpperBound() const
void attach(ConstAlias< EuclideanShape > shape)
const Point & getLowerBound() const
void init(const RealPoint &xLow, const RealPoint &xUp, typename RealVector::Component gridStep)
Aim: describes, in a cellular space of dimension n, a closed or open sequence of signed d-cells (or d...
bool initFromVector(const std::vector< Point > &aVectorOfPoints)
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
Aim: implements a functor that estimates the arc length of a paramtric curve.
Aim: model of CBidirectionalRangeFromPoint that adapts any range of elements bounded by two iterators...
DGtal::Circulator< ConstIterator > ConstCirculator
Aim: A utility class for constructing surfaces (i.e. set of (n-1)-cells).
static SCell findABel(const KSpace &K, const PointPredicate &pp, unsigned int nbtries=1000)
Aim: Represent adjacencies between surfel elements, telling if it follows an interior to exterior ord...
Aim: Computes the true quantity associated to a parametric shape or to a subrange associated to a par...
void clear(const DGtal::Color &color=DGtal::Color::None)
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
DGtal is the top-level namespace which contains all DGtal functions and types.
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
int main(int argc, char **argv)