31#if defined(ShortcutsGeometry_RECURSES)
32#error Recursive header files inclusion detected in ShortcutsGeometry.h
35#define ShortcutsGeometry_RECURSES
37#if !defined ShortcutsGeometry_h
39#define ShortcutsGeometry_h
42#include "DGtal/helpers/Shortcuts.h"
43#include "DGtal/geometry/volumes/distance/LpMetric.h"
44#include "DGtal/geometry/volumes/distance/ExactPredicateLpSeparableMetric.h"
45#include "DGtal/geometry/surfaces/estimation/TrueDigitalSurfaceLocalEstimator.h"
46#include "DGtal/geometry/surfaces/estimation/VoronoiCovarianceMeasureOnDigitalSurface.h"
47#include "DGtal/geometry/surfaces/estimation/VCMDigitalSurfaceLocalEstimator.h"
48#include "DGtal/geometry/surfaces/estimation/IIGeometricFunctors.h"
49#include "DGtal/geometry/surfaces/estimation/IntegralInvariantVolumeEstimator.h"
50#include "DGtal/geometry/surfaces/estimation/IntegralInvariantCovarianceEstimator.h"
51#include "DGtal/geometry/meshes/CorrectedNormalCurrentComputer.h"
53#include "DGtal/dec/DiscreteExteriorCalculusFactory.h"
54#include "DGtal/dec/ATSolver2D.h"
60 namespace sgf = ::DGtal::functors::ShapeGeometricFunctors;
74 template <
typename TKSpace >
143 typedef typename LightDigitalSurface::Arc
Arc;
144 typedef typename LightDigitalSurface::Face
Face;
194 typedef ::DGtal::Mesh<RealPoint>
Mesh;
225 (
"projectionMaxIter", 20 )
226 (
"projectionAccuracy", 0.0001 )
227 (
"projectionGamma", 0.5 )
258 int maxIter = params[
"projectionMaxIter" ].as<
int>();
259 double accuracy = params[
"projectionAccuracy" ].as<
double>();
260 double gamma = params[
"projectionGamma" ].as<
double>();
262 true_estimator.
attach( *shape );
264 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
265 true_estimator.
eval( surfels.begin(), surfels.end(),
266 std::back_inserter( n_true_estimations ) );
267 return n_true_estimations;
290 int maxIter = params[
"projectionMaxIter" ].as<
int>();
291 double accuracy = params[
"projectionAccuracy" ].as<
double>();
292 double gamma = params[
"projectionGamma" ].as<
double>();
293 for (
unsigned int i = 0; i < points.size(); ++i )
294 proj_points[ i ] = shape->nearestPoint( points[ i ], accuracy,
326 int maxIter = params[
"projectionMaxIter" ].as<
int>();
327 double accuracy = params[
"projectionAccuracy" ].as<
double>();
328 double gamma = params[
"projectionGamma" ].as<
double>();
330 true_estimator.
attach( *shape );
332 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
333 true_estimator.
eval( surfels.begin(), surfels.end(),
334 std::back_inserter( n_true_estimations ) );
335 return n_true_estimations;
365 int maxIter = params[
"projectionMaxIter" ].as<
int>();
366 double accuracy = params[
"projectionAccuracy" ].as<
double>();
367 double gamma = params[
"projectionGamma" ].as<
double>();
369 true_estimator.
attach( *shape );
371 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
372 true_estimator.
eval( surfels.begin(), surfels.end(),
373 std::back_inserter( n_true_estimations ) );
374 return n_true_estimations;
394 const typename Base::SurfaceMesh::Faces faces,
399 bool unit_u = params[
"unit_u"].as<
int>();
400 double radius = params[
"r-radius"].as<
double>();
401 double alpha = params[
"alpha"].as<
double>();
402 double h = params[
"gridstep"].as<
double>();
403 if ( alpha != 1.0 ) radius *= pow( h, alpha-1.0 );
410 Scalars curvatures(faces.size());
411 for (
size_t i = 0; i < faces.size(); ++i)
413 const auto center = mesh->faceCentroid(faces[i]);
414 const auto area = mu0.measure(center, radius, faces[i]);
415 const auto lmu1 = mu1.measure(center, radius, faces[i]);
445 std::vector<typename Base::SurfaceMesh::Face> allFaces(mesh->nbFaces());
446 std::iota(allFaces.begin(), allFaces.end(), 0);
469 template <
typename T>
505 int maxIter = params[
"projectionMaxIter" ].as<
int>();
506 double accuracy = params[
"projectionAccuracy" ].as<
double>();
507 double gamma = params[
"projectionGamma" ].as<
double>();
509 true_estimator.
attach( *shape );
511 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
512 true_estimator.
eval( surfels.begin(), surfels.end(),
513 std::back_inserter( n_true_estimations ) );
514 return n_true_estimations;
537 const typename Base::SurfaceMesh::Faces & faces,
542 bool unit_u = params[
"unit_u"].as<
int>();
543 double radius = params[
"r-radius"].as<
double>();
544 double alpha = params[
"alpha"].as<
double>();
545 double h = params[
"gridstep"].as<
double>();
546 if ( alpha != 1.0 ) radius *= pow( h, alpha-1.0 );
553 Scalars curvatures(faces.size());
554 for (
size_t i = 0; i < faces.size(); ++i)
556 const auto center = mesh->faceCentroid(faces[i]);
557 const auto area = mu0.measure(center, radius, faces[i]);
558 const auto lmu2 = mu2.measure(center, radius, faces[i]);
588 std::vector<typename Base::SurfaceMesh::Face> allFaces(mesh->nbFaces());
589 std::iota(allFaces.begin(), allFaces.end(), 0);
612 template <
typename T>
647 int maxIter = params[
"projectionMaxIter" ].as<
int>();
648 double accuracy = params[
"projectionAccuracy" ].as<
double>();
649 double gamma = params[
"projectionGamma" ].as<
double>();
651 true_estimator.
attach( *shape );
653 maxIter, accuracy, gamma );
654 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
655 true_estimator.
eval( surfels.begin(), surfels.end(),
656 std::back_inserter( n_true_estimations ) );
657 return n_true_estimations;
689 int maxIter = params[
"projectionMaxIter" ].as<
int>();
690 double accuracy = params[
"projectionAccuracy" ].as<
double>();
691 double gamma = params[
"projectionGamma" ].as<
double>();
693 true_estimator.
attach( *shape );
695 maxIter, accuracy, gamma );
696 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
697 true_estimator.
eval( surfels.begin(), surfels.end(),
698 std::back_inserter( n_true_estimations ) );
699 return n_true_estimations;
731 int maxIter = params[
"projectionMaxIter" ].as<
int>();
732 double accuracy = params[
"projectionAccuracy" ].as<
double>();
733 double gamma = params[
"projectionGamma" ].as<
double>();
735 true_estimator.
attach( *shape );
737 maxIter, accuracy, gamma );
738 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
739 true_estimator.
eval( surfels.begin(), surfels.end(),
740 std::back_inserter( n_true_estimations ) );
741 return n_true_estimations;
773 int maxIter = params[
"projectionMaxIter" ].as<
int>();
774 double accuracy = params[
"projectionAccuracy" ].as<
double>();
775 double gamma = params[
"projectionGamma" ].as<
double>();
777 true_estimator.
attach( *shape );
779 maxIter, accuracy, gamma );
780 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
781 true_estimator.
eval( surfels.begin(), surfels.end(),
782 std::back_inserter( n_true_estimations ) );
783 return n_true_estimations;
816 int maxIter = params[
"projectionMaxIter" ].as<
int>();
817 double accuracy = params[
"projectionAccuracy" ].as<
double>();
818 double gamma = params[
"projectionGamma" ].as<
double>();
820 true_estimator.
attach( *shape );
822 maxIter, accuracy, gamma );
823 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
824 true_estimator.
eval( surfels.begin(), surfels.end(),
825 std::back_inserter( n_true_estimations ) );
826 return n_true_estimations;
853 static std::tuple<Scalars, Scalars, RealVectors, RealVectors>
856 const typename Base::SurfaceMesh::Faces& faces,
861 bool unit_u = params[
"unit_u"].as<
int>();
862 double radius = params[
"r-radius"].as<
double>();
863 double alpha = params[
"alpha"].as<
double>();
864 double h = params[
"gridstep"].as<
double>();
865 if ( alpha != 1.0 ) radius *= pow( h, alpha-1.0 );
872 if (mesh->faceNormals().size() == 0)
875 if (mesh->vertexNormals().size() == 0)
876 mesh->computeFaceNormalsFromPositions();
878 mesh->computeFaceNormalsFromVertexNormals();
881 const auto& normals = mesh->faceNormals();
883 Scalars k1(faces.size()), k2(faces.size());
886 for (
size_t i = 0; i < faces.size(); ++i)
888 const auto center = mesh->faceCentroid(faces[i]);
889 const auto area = mu0 .measure(center, radius, faces[i]);
890 const auto lmuxy = muxy.measure(center, radius, faces[i]);
891 std::tie(k1[i], k2[i], d1[i], d2[i]) =
895 return std::make_tuple(k1, k2, d1, d2);
923 static std::tuple<Scalars, Scalars, RealVectors, RealVectors>
928 std::vector<typename Base::SurfaceMesh::Face> allFaces(mesh->nbFaces());
929 std::iota(allFaces.begin(), allFaces.end(), 0);
953 template <
typename T>
954 static std::tuple<Scalars, Scalars, RealVectors, RealVectors>
988 (
"surfelEmbedding", 0 )
1005 std::vector< RealVector > result;
1006 for (
auto s : surfels )
1009 bool direct =
K.sDirect( s, k );
1011 t[ k ] = direct ? -1.0 : 1.0;
1012 result.push_back( t );
1032 template <
typename TAnyDigitalSurface>
1039 int verbose = params[
"verbose" ].as<
int>();
1040 Scalar t = params[
"t-ring" ].as<
double>();
1041 typedef typename TAnyDigitalSurface::DigitalSurfaceContainer SurfaceContainer;
1047 < SurfaceContainer, Metric, SurfelFunctor,
Functor> NormalEstimator;
1049 trace.info() <<
"- CTrivial normal t-ring=" << t <<
" (discrete)" << std::endl;
1052 Metric aMetric( 2.0 );
1054 std::vector< RealVector > n_estimations;
1055 SurfelFunctor surfelFct( canonic_embedder, 1.0 );
1056 NormalEstimator estimator;
1058 estimator.setParams( aMetric, surfelFct, fct, t );
1059 estimator.init( 1.0, surfels.begin(), surfels.end());
1060 estimator.eval( surfels.begin(), surfels.end(),
1061 std::back_inserter( n_estimations ) );
1062 std::transform( n_estimations.cbegin(), n_estimations.cend(), n_estimations.begin(),
1064 return n_estimations;
1088 template <
typename TAnyDigitalSurface>
1096 typedef typename TAnyDigitalSurface::DigitalSurfaceContainer SurfaceContainer;
1098 int verbose = params[
"verbose" ].as<
int>();
1099 std::string kernel = params[
"kernel" ].as<std::string>();
1105 int embedding = params[
"embedding" ].as<
int>();
1107 if ( alpha != 1.0 )
R *= pow( h, alpha-1.0 );
1108 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
1113 trace.info() <<
"- VCM normal kernel=" << kernel <<
" emb=" << embedding
1114 <<
" alpha=" << alpha << std::endl;
1115 trace.info() <<
"- VCM normal r=" << (r*h) <<
" (continuous) "
1116 << r <<
" (discrete)" << std::endl;
1117 trace.info() <<
"- VCM normal R=" << (
R*h) <<
" (continuous) "
1118 <<
R <<
" (discrete)" << std::endl;
1119 trace.info() <<
"- VCM normal t=" << t <<
" (discrete)" << std::endl;
1121 if ( kernel ==
"hat" )
1125 < SurfaceContainer, Metric, KernelFunction > VCMOnSurface;
1128 < SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator;
1129 KernelFunction chi_r( 1.0, r );
1130 VCMNormalEstimator estimator;
1132 estimator.setParams( embType,
R, r, chi_r, t, Metric(), verbose > 0 );
1133 estimator.init( h, surfels.begin(), surfels.end() );
1134 estimator.eval( surfels.begin(), surfels.end(),
1135 std::back_inserter( n_estimations ) );
1137 else if ( kernel ==
"ball" )
1141 < SurfaceContainer, Metric, KernelFunction > VCMOnSurface;
1144 < SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator;
1145 KernelFunction chi_r( 1.0, r );
1146 VCMNormalEstimator estimator;
1148 estimator.setParams( embType,
R, r, chi_r, t, Metric(), verbose > 0 );
1149 estimator.init( h, surfels.begin(), surfels.end() );
1150 estimator.eval( surfels.begin(), surfels.end(),
1151 std::back_inserter( n_estimations ) );
1155 trace.warning() <<
"[ShortcutsGeometry::getVCMNormalVectors] Unknown kernel: "
1156 << kernel << std::endl;
1158 return n_estimations;
1259 template <
typename TPo
intPredicate>
1270 <
KSpace, TPointPredicate, IINormalFunctor> IINormalEstimator;
1273 int verbose = params[
"verbose" ].as<
int>();
1277 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
1280 trace.info() <<
"- II normal alpha=" << alpha << std::endl;
1281 trace.info() <<
"- II normal r=" << (r*h) <<
" (continuous) "
1282 << r <<
" (discrete)" << std::endl;
1284 IINormalFunctor functor;
1285 functor.init( h, r*h );
1286 IINormalEstimator ii_estimator( functor );
1287 ii_estimator.attach(
K, shape );
1288 ii_estimator.setParams( r );
1289 ii_estimator.init( h, surfels.begin(), surfels.end() );
1290 ii_estimator.eval( surfels.begin(), surfels.end(),
1291 std::back_inserter( n_estimations ) );
1294 return n_estimations;
1386 template <
typename TPo
intPredicate>
1397 <
KSpace, TPointPredicate, IIMeanCurvFunctor> IIMeanCurvEstimator;
1400 int verbose = params[
"verbose" ].as<
int>();
1404 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
1407 trace.info() <<
"- II mean curvature alpha=" << alpha << std::endl;
1408 trace.info() <<
"- II mean curvature r=" << (r*h) <<
" (continuous) "
1409 << r <<
" (discrete)" << std::endl;
1411 IIMeanCurvFunctor functor;
1412 functor.init( h, r*h );
1413 IIMeanCurvEstimator ii_estimator( functor );
1414 ii_estimator.attach(
K, shape );
1415 ii_estimator.setParams( r );
1416 ii_estimator.init( h, surfels.begin(), surfels.end() );
1417 ii_estimator.eval( surfels.begin(), surfels.end(),
1418 std::back_inserter( mc_estimations ) );
1419 return mc_estimations;
1510 template <
typename TPo
intPredicate>
1521 <
KSpace, TPointPredicate, IIGaussianCurvFunctor> IIGaussianCurvEstimator;
1524 int verbose = params[
"verbose" ].as<
int>();
1528 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
1531 trace.info() <<
"- II Gaussian curvature alpha=" << alpha << std::endl;
1532 trace.info() <<
"- II Gaussian curvature r=" << (r*h) <<
" (continuous) "
1533 << r <<
" (discrete)" << std::endl;
1535 IIGaussianCurvFunctor functor;
1536 functor.init( h, r*h );
1537 IIGaussianCurvEstimator ii_estimator( functor );
1538 ii_estimator.attach(
K, shape );
1539 ii_estimator.setParams( r );
1540 ii_estimator.init( h, surfels.begin(), surfels.end() );
1541 ii_estimator.eval( surfels.begin(), surfels.end(),
1542 std::back_inserter( mc_estimations ) );
1543 return mc_estimations;
1636 template <
typename TPo
intPredicate>
1649 int verbose = params[
"verbose" ].as<
int>();
1653 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
1656 trace.info() <<
"- II principal curvatures and directions alpha=" << alpha << std::endl;
1657 trace.info() <<
"- II principal curvatures and directions r=" << (r*h) <<
" (continuous) "
1658 << r <<
" (discrete)" << std::endl;
1660 IICurvFunctor functor;
1661 functor.init( h, r*h );
1662 IICurvEstimator ii_estimator( functor );
1663 ii_estimator.attach(
K, shape );
1664 ii_estimator.setParams( r );
1665 ii_estimator.init( h, surfels.begin(), surfels.end() );
1666 ii_estimator.eval( surfels.begin(), surfels.end(),
1667 std::back_inserter( mc_estimations ) );
1668 return mc_estimations;
1695 (
"at-lambda", 0.025 )
1696 (
"at-epsilon", 0.25 )
1697 (
"at-epsilon-start", 2.0 )
1698 (
"at-epsilon-ratio", 2.0 )
1699 (
"at-max-iter", 10 )
1700 (
"at-diff-v-max", 0.0001 )
1701 (
"at-v-policy",
"Maximum" );
1726 template <
typename TAnyDigitalSurface,
1727 typename VectorFieldInput>
1732 const VectorFieldInput& input,
1738 int verbose = params[
"verbose" ].as<
int>();
1741 Scalar epsilon1 = params[
"at-epsilon-start" ].as<
Scalar>();
1743 Scalar epsilonr = params[
"at-epsilon-ratio" ].as<
Scalar>();
1744 int max_iter = params[
"at-max-iter" ].as<
int>();
1745 Scalar diff_v_max= params[
"at-diff-v-max" ].as<
Scalar>();
1747 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1750 at_solver.
setUp( alpha_at, lambda_at );
1752 auto output = input;
1787 template <
typename TAnyDigitalSurface,
1788 typename VectorFieldInput,
1789 typename CellRangeConstIterator>
1793 CellRangeConstIterator itB,
1794 CellRangeConstIterator itE,
1797 const VectorFieldInput& input,
1803 int verbose = params[
"verbose" ].as<
int>();
1806 Scalar epsilon1 = params[
"at-epsilon-start" ].as<
Scalar>();
1808 Scalar epsilonr = params[
"at-epsilon-ratio" ].as<
Scalar>();
1809 int max_iter = params[
"at-max-iter" ].as<
int>();
1810 Scalar diff_v_max= params[
"at-diff-v-max" ].as<
Scalar>();
1811 std::string policy = params[
"at-v-policy" ].as<std::string>();
1813 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1816 at_solver.
setUp( alpha_at, lambda_at );
1818 auto output = input;
1820 auto p = ( policy ==
"Average" ) ? at_solver.
Average
1821 : ( policy ==
"Minimum" ) ? at_solver.
Minimum
1850 template <
typename TAnyDigitalSurface>
1861 int verbose = params[
"verbose" ].as<
int>();
1864 Scalar epsilon1 = params[
"at-epsilon-start" ].as<
Scalar>();
1866 Scalar epsilonr = params[
"at-epsilon-ratio" ].as<
Scalar>();
1867 int max_iter = params[
"at-max-iter" ].as<
int>();
1868 Scalar diff_v_max= params[
"at-diff-v-max" ].as<
Scalar>();
1870 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1873 at_solver.
setUp( alpha_at, lambda_at );
1875 auto output = input;
1914 template <
typename TAnyDigitalSurface,
1915 typename CellRangeConstIterator>
1919 CellRangeConstIterator itB,
1920 CellRangeConstIterator itE,
1929 int verbose = params[
"verbose" ].as<
int>();
1932 Scalar epsilon1 = params[
"at-epsilon-start" ].as<
Scalar>();
1934 Scalar epsilonr = params[
"at-epsilon-ratio" ].as<
Scalar>();
1935 int max_iter = params[
"at-max-iter" ].as<
int>();
1936 Scalar diff_v_max= params[
"at-diff-v-max" ].as<
Scalar>();
1937 std::string policy = params[
"at-v-policy" ].as<std::string>();
1939 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1942 at_solver.
setUp( alpha_at, lambda_at );
1944 auto output = input;
1946 auto p = ( policy ==
"Average" ) ? at_solver.
Average
1947 : ( policy ==
"Minimum" ) ? at_solver.
Minimum
1969 std::transform( ref_v.cbegin(), ref_v.cend(), v.cbegin(), v.begin(),
1971 { return rw.dot( w ) >= 0.0 ? w : -w; } );
1998 if ( v1.size() == v2.size() )
2000 auto outIt = v.begin();
2001 for (
auto it1 = v1.cbegin(), it2 = v2.cbegin(), itE1 = v1.cend();
2002 it1 != itE1; ++it1, ++it2 )
2004 Scalar angle_error = acos( (*it1).dot( *it2 ) );
2005 *outIt++ = angle_error;
2010 trace.warning() <<
"[ShortcutsGeometry::getVectorsAngleDeviation]"
2011 <<
" v1.size()=" << v1.size() <<
" should be equal to "
2012 <<
" v2.size()=" << v2.size() << std::endl;
2026 std::transform( v2.cbegin(), v2.cend(), v1.cbegin(), result.begin(),
2028 { return fabs( val1 - val2 ); } );
2043 for (
unsigned int i = 0; i < v1.size(); i++ )
2044 sum += ( v1[ i ] - v2[ i ] ) * ( v1[ i ] - v2[ i ] );
2045 return sqrt( sum / v1.size() );
2059 for (
unsigned int i = 0; i < v1.size(); i++ )
2060 sum += fabs( v1[ i ] - v2[ i ] );
2061 return sum / v1.size();
2075 for (
unsigned int i = 0; i < v1.size(); i++ )
2076 loo = std::max( loo, fabs( v1[ i ] - v2[ i ] ) );
2154#undef ShortcutsGeometry_RECURSES
Aim: This class solves Ambrosio-Tortorelli functional on a two-dimensional digital space (a 2D grid o...
void getOutputScalarFieldU2(ScalarFieldOutput &output, SurfelRangeConstIterator itB, SurfelRangeConstIterator itE)
void getOutputScalarFieldV0(ScalarFieldOutput &output, CellRangeConstIterator itB, CellRangeConstIterator itE, CellOutputPolicy policy=CellOutputPolicy::Average)
void initInputScalarFieldU2(const ScalarFieldInput &input, SurfelRangeConstIterator itB, SurfelRangeConstIterator itE)
void setUp(double a, double l)
void initInputVectorFieldU2(const VectorFieldInput &input, SurfelRangeConstIterator itB, SurfelRangeConstIterator itE, bool normalize=false)
bool solveGammaConvergence(double eps1=2.0, double eps2=0.25, double epsr=2.0, bool compute_smallest_epsilon_map=false, double n_oo_max=1e-4, unsigned int iter_max=10)
void getOutputVectorFieldU2(VectorFieldOutput &output, SurfelRangeConstIterator itB, SurfelRangeConstIterator itE)
@ Maximum
compute maximum value at cell vertices
@ Average
compute average values at cell vertices
@ Minimum
compute minimum value at cell vertices,
Aim: Smart pointer based on reference counts.
DigitalSurfaceContainer::Surfel Surfel
DigitalSurfaceContainer::Cell Cell
std::vector< Arc > ArcRange
DigitalSurfaceContainer::SCell SCell
Aim: This class provides static members to create DEC structures from various other DGtal structures.
Aim: implements separable l_p metrics with exact predicates.
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Aim: model of CEuclideanOrientedShape concepts to create a shape from a polynomial.
std::vector< Arc > ArcRange
HalfEdgeDataStructure::HalfEdgeIndex Arc
Aim: This class implement an Integral Invariant estimator which computes for each surfel the covarian...
Aim: This class implement an Integral Invariant estimator which computes for each surfel the volume o...
std::set< SCell > SurfelSet
SpaceND< dim, Integer > Space
Aim: this class adapts any local functor on digital surface element to define a local estimator....
Aim: implements l_p metrics.
LightDigitalSurface::Vertex Vertex
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< TKSpace >))
static Scalars getIIGaussianCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace())
static RealVectors getIINormalVectors(CountedPtr< DigitizedImplicitShape3D > dshape, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace()|parametersDigitizedImplicitShape3D())
static Scalar getScalarsNormL1(const Scalars &v1, const Scalars &v2)
static RealVectors getTrivialNormalVectors(const KSpace &K, const SurfelRange &surfels)
LightImplicitDigitalSurface< KSpace, BinaryImage > LightSurfaceContainer
MPolynomial< Space::dimension, Scalar > ScalarPolynomial
static Scalars getIIMeanCurvatures(CountedPtr< DigitizedImplicitShape3D > dshape, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace()|parametersDigitizedImplicitShape3D())
std::vector< IdxSurfel > IdxSurfelRange
static RealPoints getPositions(CountedPtr< ImplicitShape3D > shape, const RealPoints &points, const Parameters ¶ms=parametersShapeGeometry())
RealVector::Component Scalar
static std::tuple< Scalars, Scalars, RealVectors, RealVectors > getCNCPrincipalCurvaturesAndDirections(CountedPtr< typename Base::SurfaceMesh > mesh, const Parameters ¶ms=parametersShapeGeometry())
::DGtal::Statistic< Scalar > ScalarStatistic
ShortcutsGeometry(const ShortcutsGeometry &other)=delete
static Scalars getATScalarFieldApproximation(Scalars &features, CellRangeConstIterator itB, CellRangeConstIterator itE, CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const Scalars &input, const Parameters ¶ms=parametersATApproximation()|parametersGeometryEstimation())
static Parameters parametersGeometryEstimation()
static Scalars getMeanCurvatures(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersShapeGeometry())
static RealPoints getPositions(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersShapeGeometry())
std::map< Cell, IdxVertex > Cell2Index
static Parameters parametersKSpace()
functors::IIPrincipalCurvaturesAndDirectionsFunctor< Space >::Quantity CurvatureTensorQuantity
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, GaussianCurvatureFunctor > TrueGaussianCurvatureEstimator
static CurvatureTensorQuantities getIIPrincipalCurvaturesAndDirections(const TPointPredicate &shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace())
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
ShortcutsGeometry & operator=(const ShortcutsGeometry &other)=delete
LightDigitalSurface::SCell SCell
LightDigitalSurface::ArcRange ArcRange
sgf::ShapeGaussianCurvatureFunctor< ImplicitShape3D > GaussianCurvatureFunctor
static Parameters parametersShapeGeometry()
CorrectedNormalCurrentComputer< RealPoint, RealVector > CNCComputer
KSpace::SurfelSet SurfelSet
static CurvatureTensorQuantities getIIPrincipalCurvaturesAndDirections(CountedPtr< DigitizedImplicitShape3D > dshape, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace()|parametersDigitizedImplicitShape3D())
static Scalars getCNCGaussianCurvatures(CountedPtr< typename Base::SurfaceMesh > mesh, const typename Base::SurfaceMesh::Faces &faces, const Parameters ¶ms=parametersShapeGeometry())
ShortcutsGeometry()=delete
sgf::ShapeSecondPrincipalDirectionFunctor< ImplicitShape3D > SecondPrincipalDirectionFunctor
static CurvatureTensorQuantities getIIPrincipalCurvaturesAndDirections(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace())
static Scalars getIIGaussianCurvatures(CountedPtr< DigitizedImplicitShape3D > dshape, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace()|parametersDigitizedImplicitShape3D())
sgf::ShapePositionFunctor< ImplicitShape3D > PositionFunctor
sgf::ShapeMeanCurvatureFunctor< ImplicitShape3D > MeanCurvatureFunctor
sgf::ShapeSecondPrincipalCurvatureFunctor< ImplicitShape3D > SecondPrincipalCurvatureFunctor
static void orientVectors(RealVectors &v, const RealVectors &ref_v)
Shortcuts< Z3i::KSpace > Base
static RealVectors getIINormalVectors(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace())
static Parameters parametersATApproximation()
ShortcutsGeometry(ShortcutsGeometry &&other)=delete
static Scalars getScalarsAbsoluteDifference(const Scalars &v1, const Scalars &v2)
std::vector< CurvatureTensorQuantity > CurvatureTensorQuantities
IdxDigitalSurface::Vertex IdxVertex
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PositionFunctor > TruePositionEstimator
static RealVectors getNormalVectors(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersShapeGeometry())
::DGtal::Mesh< RealPoint > Mesh
::DGtal::TriangulatedSurface< RealPoint > TriangulatedSurface
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, SecondPrincipalDirectionFunctor > TrueSecondPrincipalDirectionEstimator
static std::tuple< Scalars, Scalars, RealVectors, RealVectors > getCNCPrincipalCurvaturesAndDirections(CountedPtr< typename Base::SurfaceMesh > mesh, const typename Base::SurfaceMesh::Faces &faces, const Parameters ¶ms=parametersShapeGeometry())
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, NormalFunctor > TrueNormalEstimator
LightDigitalSurface::Arc Arc
static RealVectors getFirstPrincipalDirections(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersShapeGeometry())
static Scalars getCNCGaussianCurvatures(T &digitalObject, const Parameters ¶ms=parametersShapeGeometry())
ImageContainerBySTLVector< Domain, GrayScale > GrayScaleImage
std::vector< Scalar > Scalars
::DGtal::PolygonalSurface< RealPoint > PolygonalSurface
static Scalars getIIMeanCurvatures(const TPointPredicate &shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace())
static RealVectors getSecondPrincipalDirections(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersShapeGeometry())
ImplicitPolynomial3Shape< Space > ImplicitShape3D
::DGtal::DigitalSurface< ExplicitSurfaceContainer > DigitalSurface
GaussDigitizer< Space, ImplicitShape3D > DigitizedImplicitShape3D
std::vector< Cell > CellRange
IdxDigitalSurface::Arc IdxArc
ImageContainerBySTLVector< Domain, float > FloatImage
SetOfSurfels< KSpace, SurfelSet > ExplicitSurfaceContainer
static RealVectors getCTrivialNormalVectors(CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation())
LightDigitalSurface::Face Face
static Scalars getCNCMeanCurvatures(CountedPtr< typename Base::SurfaceMesh > mesh, const typename Base::SurfaceMesh::Faces faces, const Parameters ¶ms=parametersShapeGeometry())
~ShortcutsGeometry()=delete
static Scalars getIIMeanCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace())
ImageContainerBySTLVector< Domain, double > DoubleImage
static std::tuple< Scalars, Scalars, RealVectors, RealVectors > getCNCPrincipalCurvaturesAndDirections(T &digitalObject, const Parameters ¶ms=parametersShapeGeometry())
std::set< IdxSurfel > IdxSurfelSet
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, SecondPrincipalCurvatureFunctor > TrueSecondPrincipalCurvatureEstimator
Space::RealVector RealVector
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, FirstPrincipalCurvatureFunctor > TrueFirstPrincipalCurvatureEstimator
ShortcutsGeometry< Z3i::KSpace > Self
static CurvatureTensorQuantities getPrincipalCurvaturesAndDirections(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersShapeGeometry())
static Parameters defaultParameters()
static Scalars getCNCMeanCurvatures(T &digitalObject, const Parameters ¶ms=parametersShapeGeometry())
::DGtal::DigitalSurface< LightSurfaceContainer > LightDigitalSurface
static Scalars getGaussianCurvatures(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersShapeGeometry())
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, PrincipalCurvaturesAndDirectionsFunctor > TruePrincipalCurvaturesAndDirectionsEstimator
std::vector< Surfel > SurfelRange
static RealVectors getIINormalVectors(const TPointPredicate &shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace())
static Scalars getVectorsAngleDeviation(const RealVectors &v1, const RealVectors &v2)
static Scalars getCNCGaussianCurvatures(CountedPtr< typename Base::SurfaceMesh > mesh, const Parameters ¶ms=parametersShapeGeometry())
static Scalar getScalarsNormL2(const Scalars &v1, const Scalars &v2)
Space::RealPoint RealPoint
IndexedDigitalSurface< ExplicitSurfaceContainer > IdxDigitalSurface
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, MeanCurvatureFunctor > TrueMeanCurvatureEstimator
static Scalars getFirstPrincipalCurvatures(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersShapeGeometry())
sgf::ShapeNormalVectorFunctor< ImplicitShape3D > NormalFunctor
sgf::ShapeFirstPrincipalDirectionFunctor< ImplicitShape3D > FirstPrincipalDirectionFunctor
IdxDigitalSurface::Vertex IdxSurfel
static Scalar getScalarsNormLoo(const Scalars &v1, const Scalars &v2)
static Parameters parametersDigitizedImplicitShape3D()
static ScalarStatistic getStatistic(const Scalars &v)
static Scalars getATScalarFieldApproximation(CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const Scalars &input, const Parameters ¶ms=parametersATApproximation()|parametersGeometryEstimation())
LightDigitalSurface::Cell Cell
LightDigitalSurface::Surfel Surfel
sgf::ShapeFirstPrincipalCurvatureFunctor< ImplicitShape3D > FirstPrincipalCurvatureFunctor
HyperRectDomain< Space > Domain
static Scalars getIIGaussianCurvatures(const TPointPredicate &shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace())
std::vector< RealPoint > RealPoints
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, FirstPrincipalDirectionFunctor > TrueFirstPrincipalDirectionEstimator
sgf::ShapePrincipalCurvaturesAndDirectionsFunctor< ImplicitShape3D > PrincipalCurvaturesAndDirectionsFunctor
static VectorFieldInput getATVectorFieldApproximation(CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const VectorFieldInput &input, const Parameters ¶ms=parametersATApproximation()|parametersGeometryEstimation())
static Scalars getCNCMeanCurvatures(CountedPtr< typename Base::SurfaceMesh > mesh, const Parameters ¶ms=parametersShapeGeometry())
static Scalars getSecondPrincipalCurvatures(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersShapeGeometry())
static VectorFieldInput getATVectorFieldApproximation(Scalars &features, CellRangeConstIterator itB, CellRangeConstIterator itE, CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const VectorFieldInput &input, const Parameters ¶ms=parametersATApproximation()|parametersGeometryEstimation())
std::vector< RealVector > RealVectors
static RealVectors getVCMNormalVectors(CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation())
std::map< Surfel, IdxSurfel > Surfel2Index
IdxDigitalSurface::ArcRange IdxArcRange
ImageContainerBySTLVector< Domain, bool > BinaryImage
static Parameters parametersKSpace()
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
LightDigitalSurface::Face Face
static Parameters parametersDigitizedImplicitShape3D()
static CountedPtr< SurfaceMesh > makePrimalSurfaceMesh(Cell2Index &c2i, CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
PointVector< dim, Integer > Point
PointVector< dim, double > RealPoint
PointVector< dim, double > RealVector
PointVector< dim, Integer > Vector
void addValues(Iter b, Iter e)
Aim: An estimator on digital surfaces that returns the reference local geometric quantity....
void init(const Scalar _h, SurfelConstIterator itb, SurfelConstIterator ite)
Quantity eval(SurfelConstIterator it) const
void setParams(ConstAlias< KSpace > ks, Clone< GeometricFunctor > fct, const int maxIter=20, const Scalar accuracy=0.0001, const Scalar gamma=0.5)
void attach(ConstAlias< Shape > aShape)
Aim: This class adapts a VoronoiCovarianceMeasureOnDigitalSurface to be a model of CDigitalSurfaceLoc...
Aim: This class specializes the Voronoi covariance measure for digital surfaces. It adds notably the ...
Aim: Estimates normal vector by convolution of elementary normal vector to adjacent surfel.
Aim: A functor Matrix -> RealVector that returns the normal direction by diagonalizing the given cova...
Aim: A functor Matrix -> std::pair<RealVector,RealVector> that returns the first and the second princ...
std::tuple< double, double, RealVector, RealVector > Quantity
CountedPtr< SH3::DigitalSurface > surface
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::uint32_t Dimension
Surfel2PointEmbedding
Possible embeddings for surfel as point(s)
Aim: A trivial embedder for signed cell, which corresponds to the canonic injection of cell centroids...
Aim: Utility class to compute curvature measures induced by (1) a corrected normal current defined by...
ScalarMeasure computeMu1() const
ScalarMeasure computeMu2() const
static std::tuple< Scalar, Scalar, RealVector, RealVector > principalCurvatures(Scalar mu0, RealTensor muXY, const RealVector &N)
static Scalar meanCurvature(Scalar mu0, Scalar mu1)
static Scalar GaussianCurvature(Scalar mu0, Scalar mu2)
TensorMeasure computeMuXY() const
ScalarMeasure computeMu0() const
Aim: This concept describes a cellular grid space in nD. In these spaces obtained by cartesian produc...
Aim: A functor Matrix -> Real that returns the Gaussian curvature by diagonalizing the given covarian...
Aim: A functor Real -> Real that returns the 3d mean curvature by transforming the given volume....
Aim: A functor Surfel -> Quantity that returns the outer normal vector at given surfel.