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/kernel/BasicPointPredicates.h"
44#include "DGtal/geometry/volumes/distance/LpMetric.h"
45#include "DGtal/geometry/volumes/distance/ExactPredicateLpSeparableMetric.h"
46#include "DGtal/geometry/volumes/distance/VoronoiMap.h"
47#include "DGtal/geometry/volumes/distance/DistanceTransformation.h"
48#include "DGtal/geometry/surfaces/estimation/TrueDigitalSurfaceLocalEstimator.h"
49#include "DGtal/geometry/surfaces/estimation/VoronoiCovarianceMeasureOnDigitalSurface.h"
50#include "DGtal/geometry/surfaces/estimation/VCMDigitalSurfaceLocalEstimator.h"
51#include "DGtal/geometry/surfaces/estimation/IIGeometricFunctors.h"
52#include "DGtal/geometry/surfaces/estimation/IntegralInvariantVolumeEstimator.h"
53#include "DGtal/geometry/surfaces/estimation/IntegralInvariantCovarianceEstimator.h"
54#ifdef DGTAL_WITH_OPENMP
55#include "DGtal/geometry/surfaces/estimation/ParallelIIEstimator.h"
56#include "DGtal/kernel/domains/DomainSplitter.h"
58#include "DGtal/geometry/meshes/CorrectedNormalCurrentComputer.h"
60#include "DGtal/dec/DiscreteExteriorCalculusFactory.h"
61#include "DGtal/dec/ATSolver2D.h"
67 namespace sgf = ::DGtal::functors::ShapeGeometricFunctors;
81 template <
typename TKSpace >
102 typedef typename Space::Point
Point;
201 typedef ::DGtal::Mesh<RealPoint>
Mesh;
236 (
"projectionMaxIter", 20 )
237 (
"projectionAccuracy", 0.0001 )
238 (
"projectionGamma", 0.5 )
269 int maxIter = params[
"projectionMaxIter" ].as<
int>();
270 double accuracy = params[
"projectionAccuracy" ].as<
double>();
271 double gamma = params[
"projectionGamma" ].as<
double>();
273 true_estimator.
attach( *shape );
275 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
276 true_estimator.
eval( surfels.begin(), surfels.end(),
277 std::back_inserter( n_true_estimations ) );
278 return n_true_estimations;
301 int maxIter = params[
"projectionMaxIter" ].as<
int>();
302 double accuracy = params[
"projectionAccuracy" ].as<
double>();
303 double gamma = params[
"projectionGamma" ].as<
double>();
304 for (
unsigned int i = 0; i < points.size(); ++i )
305 proj_points[ i ] = shape->nearestPoint( points[ i ], accuracy,
337 int maxIter = params[
"projectionMaxIter" ].as<
int>();
338 double accuracy = params[
"projectionAccuracy" ].as<
double>();
339 double gamma = params[
"projectionGamma" ].as<
double>();
341 true_estimator.
attach( *shape );
343 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
344 true_estimator.
eval( surfels.begin(), surfels.end(),
345 std::back_inserter( n_true_estimations ) );
346 return n_true_estimations;
376 int maxIter = params[
"projectionMaxIter" ].as<
int>();
377 double accuracy = params[
"projectionAccuracy" ].as<
double>();
378 double gamma = params[
"projectionGamma" ].as<
double>();
380 true_estimator.
attach( *shape );
382 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
383 true_estimator.
eval( surfels.begin(), surfels.end(),
384 std::back_inserter( n_true_estimations ) );
385 return n_true_estimations;
405 const typename Base::SurfaceMesh::Faces faces,
408 bool unit_u = params[
"unit_u"].as<
int>();
409 double radius = params[
"r-radius"].as<
double>();
410 double alpha = params[
"alpha"].as<
double>();
411 double h = params[
"gridstep"].as<
double>();
412 if ( alpha != 1.0 ) radius *= pow( h, alpha-1.0 );
419 Scalars curvatures(faces.size());
420 for (
size_t i = 0; i < faces.size(); ++i)
422 const auto center = mesh->faceCentroid(faces[i]);
423 const auto area = mu0.measure(center, radius, faces[i]);
424 const auto lmu1 = mu1.measure(center, radius, faces[i]);
454 std::vector<typename Base::SurfaceMesh::Face> allFaces(mesh->nbFaces());
455 std::iota(allFaces.begin(), allFaces.end(), 0);
478 template <
typename T>
514 int maxIter = params[
"projectionMaxIter" ].as<
int>();
515 double accuracy = params[
"projectionAccuracy" ].as<
double>();
516 double gamma = params[
"projectionGamma" ].as<
double>();
518 true_estimator.
attach( *shape );
520 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
521 true_estimator.
eval( surfels.begin(), surfels.end(),
522 std::back_inserter( n_true_estimations ) );
523 return n_true_estimations;
546 const typename Base::SurfaceMesh::Faces & faces,
549 bool unit_u = params[
"unit_u"].as<
int>();
550 double radius = params[
"r-radius"].as<
double>();
551 double alpha = params[
"alpha"].as<
double>();
552 double h = params[
"gridstep"].as<
double>();
553 if ( alpha != 1.0 ) radius *= pow( h, alpha-1.0 );
560 Scalars curvatures(faces.size());
561 for (
size_t i = 0; i < faces.size(); ++i)
563 const auto center = mesh->faceCentroid(faces[i]);
564 const auto area = mu0.measure(center, radius, faces[i]);
565 const auto lmu2 = mu2.measure(center, radius, faces[i]);
595 std::vector<typename Base::SurfaceMesh::Face> allFaces(mesh->nbFaces());
596 std::iota(allFaces.begin(), allFaces.end(), 0);
619 template <
typename T>
654 int maxIter = params[
"projectionMaxIter" ].as<
int>();
655 double accuracy = params[
"projectionAccuracy" ].as<
double>();
656 double gamma = params[
"projectionGamma" ].as<
double>();
658 true_estimator.
attach( *shape );
660 maxIter, accuracy, gamma );
661 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
662 true_estimator.
eval( surfels.begin(), surfels.end(),
663 std::back_inserter( n_true_estimations ) );
664 return n_true_estimations;
696 int maxIter = params[
"projectionMaxIter" ].as<
int>();
697 double accuracy = params[
"projectionAccuracy" ].as<
double>();
698 double gamma = params[
"projectionGamma" ].as<
double>();
700 true_estimator.
attach( *shape );
702 maxIter, accuracy, gamma );
703 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
704 true_estimator.
eval( surfels.begin(), surfels.end(),
705 std::back_inserter( n_true_estimations ) );
706 return n_true_estimations;
738 int maxIter = params[
"projectionMaxIter" ].as<
int>();
739 double accuracy = params[
"projectionAccuracy" ].as<
double>();
740 double gamma = params[
"projectionGamma" ].as<
double>();
742 true_estimator.
attach( *shape );
744 maxIter, accuracy, gamma );
745 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
746 true_estimator.
eval( surfels.begin(), surfels.end(),
747 std::back_inserter( n_true_estimations ) );
748 return n_true_estimations;
780 int maxIter = params[
"projectionMaxIter" ].as<
int>();
781 double accuracy = params[
"projectionAccuracy" ].as<
double>();
782 double gamma = params[
"projectionGamma" ].as<
double>();
784 true_estimator.
attach( *shape );
786 maxIter, accuracy, gamma );
787 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
788 true_estimator.
eval( surfels.begin(), surfels.end(),
789 std::back_inserter( n_true_estimations ) );
790 return n_true_estimations;
823 int maxIter = params[
"projectionMaxIter" ].as<
int>();
824 double accuracy = params[
"projectionAccuracy" ].as<
double>();
825 double gamma = params[
"projectionGamma" ].as<
double>();
827 true_estimator.
attach( *shape );
829 maxIter, accuracy, gamma );
830 true_estimator.
init( gridstep, surfels.begin(), surfels.end() );
831 true_estimator.
eval( surfels.begin(), surfels.end(),
832 std::back_inserter( n_true_estimations ) );
833 return n_true_estimations;
860 static std::tuple<Scalars, Scalars, RealVectors, RealVectors>
863 const typename Base::SurfaceMesh::Faces& faces,
866 bool unit_u = params[
"unit_u"].as<
int>();
867 double radius = params[
"r-radius"].as<
double>();
868 double alpha = params[
"alpha"].as<
double>();
869 double h = params[
"gridstep"].as<
double>();
870 if ( alpha != 1.0 ) radius *= pow( h, alpha-1.0 );
877 if (mesh->faceNormals().size() == 0)
880 if (mesh->vertexNormals().size() == 0)
881 mesh->computeFaceNormalsFromPositions();
883 mesh->computeFaceNormalsFromVertexNormals();
886 const auto& normals = mesh->faceNormals();
888 Scalars k1(faces.size()), k2(faces.size());
891 for (
size_t i = 0; i < faces.size(); ++i)
893 const auto center = mesh->faceCentroid(faces[i]);
894 const auto area = mu0 .measure(center, radius, faces[i]);
895 const auto lmuxy = muxy.measure(center, radius, faces[i]);
896 std::tie(k1[i], k2[i], d1[i], d2[i]) =
900 return std::make_tuple(k1, k2, d1, d2);
928 static std::tuple<Scalars, Scalars, RealVectors, RealVectors>
933 std::vector<typename Base::SurfaceMesh::Face> allFaces(mesh->nbFaces());
934 std::iota(allFaces.begin(), allFaces.end(), 0);
958 template <
typename T>
959 static std::tuple<Scalars, Scalars, RealVectors, RealVectors>
999 (
"ii-thread-number", 1 )
1000 (
"ii-split-axis", 0 )
1001 (
"surfelEmbedding", 0 )
1018 std::vector< RealVector > result;
1019 for (
auto s : surfels )
1022 bool direct =
K.sDirect( s, k );
1024 t[ k ] = direct ? -1.0 : 1.0;
1025 result.push_back( t );
1045 template <
typename TAnyDigitalSurface>
1052 int verbose = params[
"verbose" ].as<
int>();
1053 Scalar t = params[
"t-ring" ].as<
double>();
1054 typedef typename TAnyDigitalSurface::DigitalSurfaceContainer SurfaceContainer;
1060 < SurfaceContainer, Metric, SurfelFunctor,
Functor> NormalEstimator;
1062 trace.
info() <<
"- CTrivial normal t-ring=" << t <<
" (discrete)" << std::endl;
1065 Metric aMetric( 2.0 );
1067 std::vector< RealVector > n_estimations;
1068 SurfelFunctor surfelFct( canonic_embedder, 1.0 );
1069 NormalEstimator estimator;
1071 estimator.setParams( aMetric, surfelFct, fct, t );
1072 estimator.init( 1.0, surfels.begin(), surfels.end());
1073 estimator.eval( surfels.begin(), surfels.end(),
1074 std::back_inserter( n_estimations ) );
1075 std::transform( n_estimations.cbegin(), n_estimations.cend(), n_estimations.begin(),
1077 return n_estimations;
1101 template <
typename TAnyDigitalSurface>
1109 typedef typename TAnyDigitalSurface::DigitalSurfaceContainer SurfaceContainer;
1111 int verbose = params[
"verbose" ].as<
int>();
1112 std::string kernel = params[
"kernel" ].as<std::string>();
1118 int embedding = params[
"embedding" ].as<
int>();
1120 if ( alpha != 1.0 )
R *= pow( h, alpha-1.0 );
1121 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
1126 trace.
info() <<
"- VCM normal kernel=" << kernel <<
" emb=" << embedding
1127 <<
" alpha=" << alpha << std::endl;
1128 trace.
info() <<
"- VCM normal r=" << (r*h) <<
" (continuous) "
1129 << r <<
" (discrete)" << std::endl;
1130 trace.
info() <<
"- VCM normal R=" << (
R*h) <<
" (continuous) "
1131 <<
R <<
" (discrete)" << std::endl;
1132 trace.
info() <<
"- VCM normal t=" << t <<
" (discrete)" << std::endl;
1134 if ( kernel ==
"hat" )
1138 < SurfaceContainer, Metric, KernelFunction > VCMOnSurface;
1141 < SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator;
1142 KernelFunction chi_r( 1.0, r );
1143 VCMNormalEstimator estimator;
1145 estimator.setParams( embType,
R, r, chi_r, t, Metric(), verbose > 0 );
1146 estimator.init( h, surfels.begin(), surfels.end() );
1147 estimator.eval( surfels.begin(), surfels.end(),
1148 std::back_inserter( n_estimations ) );
1150 else if ( kernel ==
"ball" )
1154 < SurfaceContainer, Metric, KernelFunction > VCMOnSurface;
1157 < SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator;
1158 KernelFunction chi_r( 1.0, r );
1159 VCMNormalEstimator estimator;
1161 estimator.setParams( embType,
R, r, chi_r, t, Metric(), verbose > 0 );
1162 estimator.init( h, surfels.begin(), surfels.end() );
1163 estimator.eval( surfels.begin(), surfels.end(),
1164 std::back_inserter( n_estimations ) );
1168 trace.
warning() <<
"[ShortcutsGeometry::getVCMNormalVectors] Unknown kernel: "
1169 << kernel << std::endl;
1171 return n_estimations;
1290 template <
typename TPo
intPredicate>
1301 <
KSpace, TPointPredicate, IINormalFunctor> IINormalEstimator;
1304 int verbose = params[
"verbose" ].as<
int>();
1305 int ii_thread_number = params[
"ii-thread-number" ].as<
int>();
1310 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
1313 trace.
info() <<
"- II normal alpha=" << alpha << std::endl;
1314 trace.
info() <<
"- II normal r=" << (r*h) <<
" (continuous) "
1315 << r <<
" (discrete)" << std::endl;
1317 IINormalFunctor functor;
1318 functor.init( h, r*h );
1319 bool use_parallel =
false;
1320#ifdef DGTAL_WITH_OPENMP
1321 if ( ii_thread_number != 1 )
1323 use_parallel =
true;
1325 trace.
info() <<
"- II normal uses ParallelIIEstimator with thread request="
1326 << ii_thread_number <<
" and split axis="
1327 << ii_split_axis << std::endl;
1331 ParallelEstimator ii_estimator(
splitter, ii_thread_number, functor );
1332 ii_estimator.attach(
K, shape );
1333 ii_estimator.setParams( r );
1334 ii_estimator.init( h, surfels.begin(), surfels.end() );
1335 ii_estimator.eval( surfels.begin(), surfels.end(),
1336 std::back_inserter( n_estimations ) );
1339 if ( ( ii_thread_number != 1 ) && ( verbose > 0 ) )
1340 trace.
warning() <<
"- II normal requested parallel execution but DGtal was built without OpenMP; "
1341 <<
"falling back to the sequential estimator."
1344 if ( ! use_parallel )
1346 IINormalEstimator ii_estimator( functor );
1347 ii_estimator.attach(
K, shape );
1348 ii_estimator.setParams( r );
1349 ii_estimator.init( h, surfels.begin(), surfels.end() );
1350 ii_estimator.eval( surfels.begin(), surfels.end(),
1351 std::back_inserter( n_estimations ) );
1355 return n_estimations;
1465 template <
typename TPo
intPredicate>
1476 <
KSpace, TPointPredicate, IIMeanCurvFunctor> IIMeanCurvEstimator;
1477 return getIICurvatureEstimation<IIMeanCurvEstimator, IIMeanCurvFunctor>
1478 (
"mean curvature", shape,
K, surfels, params );
1581 template <
typename TPo
intPredicate>
1592 <
KSpace, TPointPredicate, IIGaussianCurvFunctor> IIGaussianCurvEstimator;
1593 return getIICurvatureEstimation<IIGaussianCurvEstimator, IIGaussianCurvFunctor>
1594 (
"Gaussian curvature", shape,
K, surfels, params );
1705 template <
typename TPo
intPredicate>
1716 return getIICurvatureEstimation<IICurvEstimator, IICurvFunctor>
1717 (
"principal curvatures and directions", shape,
K, surfels, params );
1744 (
"at-lambda", 0.025 )
1745 (
"at-epsilon", 0.25 )
1746 (
"at-epsilon-start", 2.0 )
1747 (
"at-epsilon-ratio", 2.0 )
1748 (
"at-max-iter", 10 )
1749 (
"at-diff-v-max", 0.0001 )
1750 (
"at-v-policy",
"Maximum" );
1775 template <
typename TAnyDigitalSurface,
1776 typename VectorFieldInput>
1781 const VectorFieldInput& input,
1787 int verbose = params[
"verbose" ].as<
int>();
1790 Scalar epsilon1 = params[
"at-epsilon-start" ].as<
Scalar>();
1792 Scalar epsilonr = params[
"at-epsilon-ratio" ].as<
Scalar>();
1793 int max_iter = params[
"at-max-iter" ].as<
int>();
1794 Scalar diff_v_max= params[
"at-diff-v-max" ].as<
Scalar>();
1796 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1799 at_solver.
setUp( alpha_at, lambda_at );
1836 template <
typename TAnyDigitalSurface,
1837 typename VectorFieldInput,
1838 typename CellRangeConstIterator>
1842 CellRangeConstIterator itB,
1843 CellRangeConstIterator itE,
1846 const VectorFieldInput& input,
1852 int verbose = params[
"verbose" ].as<
int>();
1855 Scalar epsilon1 = params[
"at-epsilon-start" ].as<
Scalar>();
1857 Scalar epsilonr = params[
"at-epsilon-ratio" ].as<
Scalar>();
1858 int max_iter = params[
"at-max-iter" ].as<
int>();
1859 Scalar diff_v_max= params[
"at-diff-v-max" ].as<
Scalar>();
1860 std::string policy = params[
"at-v-policy" ].as<std::string>();
1862 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1865 at_solver.
setUp( alpha_at, lambda_at );
1869 auto p = ( policy ==
"Average" ) ? at_solver.
Average
1870 : ( policy ==
"Minimum" ) ? at_solver.
Minimum
1899 template <
typename TAnyDigitalSurface>
1910 int verbose = params[
"verbose" ].as<
int>();
1913 Scalar epsilon1 = params[
"at-epsilon-start" ].as<
Scalar>();
1915 Scalar epsilonr = params[
"at-epsilon-ratio" ].as<
Scalar>();
1916 int max_iter = params[
"at-max-iter" ].as<
int>();
1917 Scalar diff_v_max= params[
"at-diff-v-max" ].as<
Scalar>();
1919 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1922 at_solver.
setUp( alpha_at, lambda_at );
1963 template <
typename TAnyDigitalSurface,
1964 typename CellRangeConstIterator>
1968 CellRangeConstIterator itB,
1969 CellRangeConstIterator itE,
1978 int verbose = params[
"verbose" ].as<
int>();
1981 Scalar epsilon1 = params[
"at-epsilon-start" ].as<
Scalar>();
1983 Scalar epsilonr = params[
"at-epsilon-ratio" ].as<
Scalar>();
1984 int max_iter = params[
"at-max-iter" ].as<
int>();
1985 Scalar diff_v_max= params[
"at-diff-v-max" ].as<
Scalar>();
1986 std::string policy = params[
"at-v-policy" ].as<std::string>();
1988 const auto calculus = CalculusFactory::createFromNSCells<2>( surfels.cbegin(), surfels.cend() );
1991 at_solver.
setUp( alpha_at, lambda_at );
1995 auto p = ( policy ==
"Average" ) ? at_solver.
Average
1996 : ( policy ==
"Minimum" ) ? at_solver.
Minimum
2018 std::transform( ref_v.cbegin(), ref_v.cend(), v.cbegin(), v.begin(),
2020 { return rw.dot( w ) >= 0.0 ? w : -w; } );
2047 if ( v1.size() == v2.size() )
2049 auto outIt = v.begin();
2050 for (
auto it1 = v1.cbegin(), it2 = v2.cbegin(), itE1 = v1.cend();
2051 it1 != itE1; ++it1, ++it2 )
2053 Scalar angle_error = acos( (*it1).dot( *it2 ) );
2054 *outIt++ = angle_error;
2059 trace.
warning() <<
"[ShortcutsGeometry::getVectorsAngleDeviation]"
2060 <<
" v1.size()=" << v1.size() <<
" should be equal to "
2061 <<
" v2.size()=" << v2.size() << std::endl;
2075 std::transform( v2.cbegin(), v2.cend(), v1.cbegin(), result.begin(),
2077 { return fabs( val1 - val2 ); } );
2092 for (
unsigned int i = 0; i < v1.size(); i++ )
2093 sum += ( v1[ i ] - v2[ i ] ) * ( v1[ i ] - v2[ i ] );
2094 return sqrt( sum / v1.size() );
2108 for (
unsigned int i = 0; i < v1.size(); i++ )
2109 sum += fabs( v1[ i ] - v2[ i ] );
2110 return sum / v1.size();
2124 for (
unsigned int i = 0; i < v1.size(); i++ )
2125 loo = std::max( loo, fabs( v1[ i ] - v2[ i ] ) );
2143 (
"toroidal-x" , false )
2144 (
"toroidal-y" ,
false )
2145 (
"toroidal-z" , false );
2163 template<u
int32_t p,
typename Po
intRange>
2175 typename VoroMap::PeriodicitySpec specs = {
false,
false,
false};
2176 if (params[
"toroidal-x"].as<int>()) specs[0] =
true;
2177 if (params[
"toroidal-y"].as<int>()) specs[1] =
true;
2178 if (params[
"toroidal-z"].as<int>()) specs[2] =
true;
2184 return VoroMap(
domain, predicate, metric, specs);
2200 template<u
int32_t p,
typename Po
intRange>
2212 typename VoroMap::PeriodicitySpec specs = {
false,
false,
false};
2213 if (params[
"toroidal-x"].as<int>()) specs[0] =
true;
2214 if (params[
"toroidal-y"].as<int>()) specs[1] =
true;
2215 if (params[
"toroidal-z"].as<int>()) specs[2] =
true;
2220 return VoroMap(*
domain, predicate, metric, specs);
2239 template<u
int32_t p,
typename Po
intRange>
2251 typename DTMap::PeriodicitySpec specs = {
false,
false,
false};
2252 if (params[
"toroidal-x"].as<int>()) specs[0] =
true;
2253 if (params[
"toroidal-y"].as<int>()) specs[1] =
true;
2254 if (params[
"toroidal-z"].as<int>()) specs[2] =
true;
2259 return DTMap(
domain, predicate, metric, specs);
2277 template<u
int32_t p,
typename Po
intRangeSites,
typename Po
intRange>
2280 const PointRangeSites& sites,
2287 Point pmin = *points.begin();
2291 for (
auto it = points.begin(); it != points.end(); ++it)
2294 for (
size_t i = 0; i < Space::dimension; ++i)
2296 pmin[i] = std::min(pmin[i], (*it)[i] - 1);
2297 pmax[i] = std::max(pmax[i], (*it)[i] + 1);
2301 for (
auto it = sites.begin(); it != sites.end(); ++it)
2303 for (
size_t i = 0; i < Space::dimension; ++i)
2305 pmin[i] = std::min(pmin[i], (*it)[i] - 1);
2306 pmax[i] = std::max(pmax[i], (*it)[i] + 1);
2317 typename VoroMap::PeriodicitySpec specs = {
false,
false,
false};
2318 if (params[
"toroidal-x"].as<int>()) specs[0] =
true;
2319 if (params[
"toroidal-y"].as<int>()) specs[1] =
true;
2320 if (params[
"toroidal-z"].as<int>()) specs[2] =
true;
2322 auto map = VoroMap(
domain, predicate, metric, specs);
2324 std::vector<Vector> directions(pCount);
2326 for (
auto it = points.begin(); it != points.end(); ++it)
2328 directions[i++] = map(*it);
2347 template<u
int32_t p,
typename Po
intRangeSites,
typename Po
intRange>
2350 const PointRangeSites& sites,
2357 Point pmin = *points.begin();
2361 for (
auto it = points.begin(); it != points.end(); ++it)
2364 for (
size_t i = 0; i < Space::dimension; ++i)
2366 pmin[i] = std::min(pmin[i], (*it)[i] - 1);
2367 pmax[i] = std::max(pmax[i], (*it)[i] + 1);
2371 for (
auto it = sites.begin(); it != sites.end(); ++it)
2373 for (
size_t i = 0; i < Space::dimension; ++i)
2375 pmin[i] = std::min(pmin[i], (*it)[i] - 1);
2376 pmax[i] = std::max(pmax[i], (*it)[i] + 1);
2386 typename DTMap::PeriodicitySpec specs = {
false,
false,
false};
2387 if (params[
"toroidal-x"].as<int>()) specs[0] =
true;
2388 if (params[
"toroidal-y"].as<int>()) specs[1] =
true;
2389 if (params[
"toroidal-z"].as<int>()) specs[2] =
true;
2391 auto map = DTMap(
domain, predicate, metric, specs);
2393 std::vector<typename Metric::Value> directions(pCount);
2395 for (
auto it = points.begin(); it != points.end(); ++it)
2397 directions[i++] = map(*it);
2419 template<u
int32_t p,
typename Po
intRangeSites,
typename Po
intRange>
2422 const PointRangeSites& sites,
2429 Point pmin = *points.begin();
2433 for (
auto it = points.begin(); it != points.end(); ++it)
2436 for (
size_t i = 0; i < Space::dimension; ++i)
2438 pmin[i] = std::min(pmin[i], (*it)[i] - 1);
2439 pmax[i] = std::max(pmax[i], (*it)[i] + 1);
2443 for (
auto it = sites.begin(); it != sites.end(); ++it)
2445 for (
size_t i = 0; i < Space::dimension; ++i)
2447 pmin[i] = std::min(pmin[i], (*it)[i] - 1);
2448 pmax[i] = std::max(pmax[i], (*it)[i] + 1);
2458 typename DTMap::PeriodicitySpec specs = {
false,
false,
false};
2459 if (params[
"toroidal-x"].as<int>()) specs[0] =
true;
2460 if (params[
"toroidal-y"].as<int>()) specs[1] =
true;
2461 if (params[
"toroidal-z"].as<int>()) specs[2] =
true;
2463 auto map = DTMap(
domain, predicate, metric, specs);
2465 std::vector<typename Metric::Value> directions(pCount);
2467 for (
auto it = points.begin(); it != points.end(); ++it)
2469 directions[i++] = map(*it);
2529 template <
typename TEstimator,
typename TFunctor,
typename TPo
intPredicate>
2530 static std::vector<typename TEstimator::Quantity>
2532 const TPointPredicate& shape,
2537 using Quantities = std::vector<typename TEstimator::Quantity>;
2538 Quantities estimations;
2539 int verbose = params[
"verbose" ].as<
int>();
2540 int ii_thread_number = params[
"ii-thread-number" ].as<
int>();
2545 if ( alpha != 1.0 ) r *= pow( h, alpha-1.0 );
2548 trace.
info() <<
"- II " << description <<
" alpha=" << alpha << std::endl;
2549 trace.
info() <<
"- II " << description <<
" r=" << (r*h) <<
" (continuous) "
2550 << r <<
" (discrete)" << std::endl;
2553 functor.init( h, r*h );
2554#ifdef DGTAL_WITH_OPENMP
2555 if ( ii_thread_number != 1 )
2559 <<
" uses ParallelIIEstimator with thread request="
2560 << ii_thread_number <<
" and split axis="
2561 << ii_split_axis << std::endl;
2565 ParallelEstimator ii_estimator(
splitter, ii_thread_number, functor );
2566 ii_estimator.attach(
K, shape );
2567 ii_estimator.setParams( r );
2568 ii_estimator.init( h, surfels.begin(), surfels.end() );
2569 ii_estimator.eval( surfels.begin(), surfels.end(),
2570 std::back_inserter( estimations ) );
2574 if ( ( ii_thread_number != 1 ) && ( verbose > 0 ) )
2576 <<
" requested parallel execution but DGtal was built without OpenMP; "
2577 <<
"falling back to the sequential estimator."
2580 TEstimator ii_estimator( functor );
2581 ii_estimator.attach(
K, shape );
2582 ii_estimator.setParams( r );
2583 ii_estimator.init( h, surfels.begin(), surfels.end() );
2584 ii_estimator.eval( surfels.begin(), surfels.end(),
2585 std::back_inserter( estimations ) );
2598 const auto requested_axis = params[
"ii-split-axis" ].as<
int>();
2599 if ( requested_axis <= 0 )
return 0;
2600 if ( requested_axis >=
static_cast<int>( Domain::dimension ) )
2619#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.
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
void insert(const Point &p)
DigitalSurfaceContainer::Surfel Surfel
DigitalSurfaceContainer::Cell Cell
Surfel Vertex
Defines the type for a vertex.
std::vector< Arc > ArcRange
The range of arcs is defined as a vector.
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: A class for computing the Gauss digitization of some Euclidean shape, i.e. its intersection with...
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Space::Dimension Dimension
Aim: model of CEuclideanOrientedShape concepts to create a shape from a polynomial.
Aim: Represents a digital surface with the topology of its dual surface. Its aim is to mimic the stan...
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
Preferred type for defining a set of surfels (always signed cells).
SpaceND< dim, Integer > Space
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as the boundary of an impl...
Aim: this class adapts any local functor on digital surface element to define a local estimator....
Aim: implements l_p metrics.
Aim: Represents a multivariate polynomial, i.e. an element of , where K is some ring or field.
Run an Integral Invariant estimator in parallel.
TEuclideanRing Component
Type for Vector elements.
static Self zero
Static const for zero PointVector.
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as connected surfels....
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
LightDigitalSurface::Vertex Vertex
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< TKSpace >))
static Scalars getIIGaussianCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace())
TKSpace KSpace
Digital cellular space.
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
defines a multi-variate polynomial : RealPoint -> Scalar
static Scalars getIIMeanCurvatures(CountedPtr< DigitizedImplicitShape3D > dshape, const SurfelRange &surfels, const Parameters ¶ms=parametersGeometryEstimation()|parametersKSpace()|parametersDigitizedImplicitShape3D())
std::vector< IdxSurfel > IdxSurfelRange
Space::Point Point
Point with integer coordinates.
static RealPoints getPositions(CountedPtr< ImplicitShape3D > shape, const RealPoints &points, const Parameters ¶ms=parametersShapeGeometry())
RealVector::Component Scalar
Floating-point numbers.
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())
Space::Integer Integer
Integer numbers.
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
defines a set of surfels
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
DigitalSetByAssociativeContainer< Domain, std::unordered_set< typename Domain::Point > > DigitalSet
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< TKSpace > Base
unsigned char GrayScale
The type for 8-bits gray-scale elements.
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)
static VoronoiMap< Space, VoronoiPointPredicate, ExactPredicateLpSeparableMetric< Space, p > > getVoronoiMap(CountedPtr< Domain > domain, const PointRange &sites, const Parameters ¶ms=parametersVoronoiMap())
Computes the VoronoiMap on a domain, where sites are given through a range.
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
static VoronoiMap< Space, VoronoiPointPredicate, ExactPredicateLpSeparableMetric< Space, p > > getVoronoiMap(Domain domain, const PointRange &sites, const Parameters ¶ms=parametersVoronoiMap())
Computes the VoronoiMap on a domain, where sites are given through a range.
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
defines a grey-level image with (hyper-)rectangular domain.
static std::vector< Vector > getDirectionToClosestSite(const PointRange &points, const PointRangeSites &sites, const Parameters ¶ms=parametersVoronoiMap())
Computes the vector to the closest site from a range of points.
static std::vector< typename ExactPredicateLpSeparableMetric< Space, p >::Value > getDistanceToClosestSite(const PointRange &points, const PointRangeSites &sites, const Parameters ¶ms=parametersVoronoiMap())
Computes the distances to the closest site from a range of points.
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
static Domain::Dimension getIIParallelSplitAxis(const Parameters ¶ms)
::DGtal::DigitalSurface< ExplicitSurfaceContainer > DigitalSurface
defines an arbitrary digital surface over a binary image.
static DistanceTransformation< Space, VoronoiPointPredicate, ExactPredicateLpSeparableMetric< Space, p > > getDistanceTransformation(Domain domain, const PointRange &sites, const Parameters ¶ms=parametersVoronoiMap())
Computes the Distance Transformation on a domain, where sites are given through a range.
GaussDigitizer< Space, ImplicitShape3D > DigitizedImplicitShape3D
defines the digitization of an implicit shape.
KSpace::Space Space
Digital space.
std::vector< Cell > CellRange
IdxDigitalSurface::Arc IdxArc
ImageContainerBySTLVector< Domain, float > FloatImage
defines a float image with (hyper-)rectangular domain.
SetOfSurfels< KSpace, SurfelSet > ExplicitSurfaceContainer
defines a heavy container that represents any digital surface.
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
defines a double image with (hyper-)rectangular domain.
functors::NotPointPredicate< DigitalSet > VoronoiPointPredicate
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
Vector with floating-point coordinates.
static Parameters parametersVoronoiMap()
TrueDigitalSurfaceLocalEstimator< KSpace, ImplicitShape3D, FirstPrincipalCurvatureFunctor > TrueFirstPrincipalCurvatureEstimator
ShortcutsGeometry< TKSpace > Self
static CurvatureTensorQuantities getPrincipalCurvaturesAndDirections(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms=parametersShapeGeometry())
static std::vector< typename ExactPredicateLpSeparableMetric< Space, p >::Value > getRawDistanceToClosestSite(const PointRange &points, const PointRangeSites &sites, const Parameters ¶ms=parametersVoronoiMap())
Computes the raw distances to the closest site from a range of points.
static Parameters defaultParameters()
static Scalars getCNCMeanCurvatures(T &digitalObject, const Parameters ¶ms=parametersShapeGeometry())
::DGtal::DigitalSurface< LightSurfaceContainer > LightDigitalSurface
defines a connected digital surface over a binary image.
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
Point with floating-point coordinates.
IndexedDigitalSurface< ExplicitSurfaceContainer > IdxDigitalSurface
defines a connected or not indexed digital surface.
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
static std::vector< typename TEstimator::Quantity > getIICurvatureEstimation(const char *description, const TPointPredicate &shape, const KSpace &K, const SurfelRange &surfels, const Parameters ¶ms)
LightDigitalSurface::Surfel Surfel
sgf::ShapeFirstPrincipalCurvatureFunctor< ImplicitShape3D > FirstPrincipalCurvatureFunctor
HyperRectDomain< Space > Domain
An (hyper-)rectangular domain.
Space::Vector Vector
Vector with integer coordinates.
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
defines a black and white image with (hyper-)rectangular domain.
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
static Parameters parametersKSpace()
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
static Parameters parametersDigitizedImplicitShape3D()
static CountedPtr< SurfaceMesh > makePrimalSurfaceMesh(Cell2Index &c2i, CountedPtr< ::DGtal::DigitalSurface< TContainer > > aSurface)
Aim: This class processes a set of sample values for one variable and can then compute different stat...
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: Implementation of the linear in time Voronoi map construction.
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
std::vector< Point > PointRange
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)
Splits a domain along one of the domain grid axis.
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: The predicate returns true when the point predicate given at construction return false....
Aim: A functor RealPoint -> Quantity that returns the first principal curvature at given point (i....
Aim: A functor RealPoint -> RealVector that returns the first principal direction at given point (i....
Aim: A functor RealPoint -> Quantity that returns the gaussian curvature at given point.
Aim: A functor RealPoint -> Quantity that returns the mean curvature at given point.
Aim: A functor RealPoint -> Quantity that returns the normal vector at given point.
Aim: A functor RealPoint -> Quantity that returns the position of the point itself.
Aim: A functor RealPoint -> (Scalar,Scalar,RealVector,RealVector that returns the principal curvature...
Aim: A functor RealPoint -> Quantity that returns the second principal curvature at given point (i....
Aim: A functor RealPoint -> RealVector that returns the second principal direction at given point (i....
Aim: A functor Surfel -> Quantity that returns the outer normal vector at given surfel.
AxisDomainSplitter< Domain >::SplitDomainsInfo output
AxisDomainSplitter< Domain > splitter