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"
55 using namespace DGtal;
64 bool testL1LengthEstimator(std::string &filename)
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;
129 int main(
int argc,
char** argv )
133 for (
int i = 0; i < argc; ++i )
137 std::string sinus2D4 = testPath +
"samples/sinus2D4.dat";
141 bool res = testL1LengthEstimator(sinus2D4);
142 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;