32#include "DGtal/base/Common.h"
34#include "DGtal/kernel/SpaceND.h"
35#include "DGtal/kernel/domains/HyperRectDomain.h"
36#include "DGtal/kernel/sets/DigitalSetSelector.h"
37#include "DGtal/topology/KhalimskySpaceND.h"
38#include "DGtal/topology/SurfelAdjacency.h"
39#include "DGtal/topology/SurfelNeighborhood.h"
42#include "DGtal/geometry/curves/GridCurve.h"
43#include "DGtal/geometry/2d/L1LengthEstimator.h"
44#include "DGtal/geometry/2d/TwoStepLocalLengthEstimator.h"
45#include "DGtal/geometry/2d/MLPLengthEstimator.h"
46#include "DGtal/geometry/2d/FPLengthEstimator.h"
47#include "DGtal/geometry/2d/DSSLengthEstimator.h"
49#include "ConfigTest.h"
67 trace.info() <<
"Reading GridCurve " << endl;
70 instream.open (filename.c_str(), ifstream::in);
81 trace.info() <<
"L1 length (h=1) = "<< l1length.
eval()<<std::endl;
84 trace.info() <<
"L1 length (h=10) = "<< l1length.
eval()<<std::endl;
90 trace.info() <<
"Local length (h=1) = "<< localength.eval()<<std::endl;
98 trace.info() <<
"MLP Length (h=1) = "<< MLPlength.
eval()<<std::endl;
101 trace.info() <<
"MLP Length (h=10) = "<< MLPlength.
eval()<<std::endl;
107 trace.info() <<
"FP Length (h=1) = "<< FPlength.
eval()<<std::endl;
110 trace.info() <<
"FP Length (h=10) = "<< FPlength.
eval()<<std::endl;
116 trace.info() <<
"DSS Length (h=1) = "<< DSSlength.
eval()<<std::endl;
119 trace.info() <<
"DSS Length (h=10) = "<< DSSlength.
eval()<<std::endl;
129int main(
int argc,
char** argv )
131 trace.beginBlock (
"Testing class LengthEstimators" );
132 trace.info() <<
"Args:";
133 for (
int i = 0; i < argc; ++i )
134 trace.info() <<
" " << argv[ i ];
135 trace.info() << endl;
137 std::string sinus2D4 = testPath +
"samples/sinus2D4.dat";
142 trace.emphase() << ( res ?
"Passed." :
"Error." ) << endl;
129int main(
int argc,
char** argv ) {
…}
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: a model of CGlobalCurveEstimator that computes the length of a digital curve using its FP (faith...
Quantity eval(const ConstIterator &itb, const ConstIterator &ite, const double h=1.) const
Aim: describes, in a cellular space of dimension n, a closed or open sequence of signed d-cells (or d...
ConstIterator begin() const
bool initFromVectorStream(std::istream &in)
PointsRange getPointsRange() const
ArrowsRange getArrowsRange() const
ConstIterator end() const
Aim: a simple model of CGlobalCurveEstimator that compute the length of a curve using the l_1 metric ...
Quantity eval(const ConstIterator &itb, const ConstIterator &ite, const double h) const
Aim: a model of CGlobalCurveEstimator that computes the length of a digital curve using its MLP (give...
Quantity eval(const ConstIterator &itb, const ConstIterator &ite, const double h=1.) const
Aim: a simple model of CGlobalCurveEstimator that compute the length of a curve using the l_1 metric ...
DGtal is the top-level namespace which contains all DGtal functions and types.
bool testL1LengthEstimator(std::string &filename)