32#include "DGtal/base/Common.h"
33#include "ConfigTest.h"
34#include "DGtalCatch.h"
35#include "DGtal/helpers/StdDefs.h"
36#include "DGtal/shapes/implicit/ImplicitHyperCube.h"
37#include "DGtal/shapes/implicit/ImplicitBall.h"
38#include "DGtal/shapes/GaussDigitizer.h"
39#include "DGtal/topology/LightImplicitDigitalSurface.h"
40#include "DGtal/topology/DigitalSurface.h"
41#include "DGtal/topology/CanonicSCellEmbedder.h"
42#include "DGtal/base/BasicFunctors.h"
43#include "DGtal/geometry/volumes/distance/LpMetric.h"
44#include "DGtal/geometry/surfaces/estimation/LocalEstimatorFromSurfelFunctorAdapter.h"
45#include "DGtal/geometry/surfaces/estimation/estimationFunctors/SphericalHoughNormalVectorEstimator.h"
47#ifdef DGTAL_WITH_POLYSCOPE
48 #include "DGtal/io/viewers/PolyscopeViewer.h"
61TEST_CASE(
"Testing SphericalHoughNormalVectorEstimator" )
71 Point p1( -50, -50, -50 );
72 Point p2( 50, 50, 50 );
81 gauss.init(p1,p2,1.0);
94 SphericalHough estimator(embedder,1.0 , 0.001, 1000 , 10, 1);
97 ConstFunctor constFunc(1.0);
98 Reporter reporter(
surface, l2, estimator , constFunc);
100 reporter.setParams(l2, estimator , constFunc, 10.0);
105 typedef Reporter::Quantity
Quantity;
108 trace.info() <<
"Result at begin = "<< result <<std::endl;
112 trace.info() <<
"Expecting = "<< res <<std::endl;
114 REQUIRE( std::abs(result.dot(res)) > 0.9 );
117#ifdef DGTAL_WITH_POLYSCOPE_TESTS
122 Quantity normal = reporter.eval( it );
123 viewer << DGtal::Color(static_cast<unsigned char>(255*abs(normal[0])),
124 static_cast<unsigned char>(255*abs(normal[1])),
125 static_cast<unsigned char>(255*abs(normal[2])));
126 viewer <<
K.unsigns(*it) ;
128 Point center =
K.sCoords ( *it );
61TEST_CASE(
"Testing SphericalHoughNormalVectorEstimator" ) {
…}
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...
DigitalSurfaceContainer::Surfel Surfel
DigitalSurfaceContainer::SurfelConstIterator ConstIterator
Aim: A class for computing the Gauss digitization of some Euclidean shape, i.e. its intersection with...
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball in nD....
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.
static Self diagonal(Component val=1)
void show() override
Starts the event loop and display of elements.
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: Define a simple functor that returns a constant value (0 by default).
Aim: This functor estimates normal vector for a collection of surfels using spherical accumulator bas...
CountedPtr< SH3::DigitalSurface > surface
SH3::DigitalSurface Surface
Z3i this namespace gathers the standard of types for 3D imagery.
KhalimskySpaceND< 3, Integer > KSpace
Space::RealPoint RealPoint
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: A trivial embedder for signed cell, which corresponds to the canonic injection of cell centroids...
Wrapper for array of quantities.
REQUIRE(domain.isInside(aPoint))
TEST_CASE("Testing SphericalHoughNormalVectorEstimator")