41 #include "DGtal/base/Common.h"
42 #include "DGtal/helpers/StdDefs.h"
45 #include "DGtal/kernel/BasicPointPredicates.h"
46 #include "DGtal/images/SimpleThresholdForegroundPredicate.h"
47 #include "DGtal/geometry/volumes/distance/ExactPredicateLpSeparableMetric.h"
48 #include "DGtal/geometry/volumes/distance/VoronoiMap.h"
49 #include "DGtal/geometry/volumes/distance/DistanceTransformation.h"
51 #include "DGtal/io/colormaps/HueShadeColorMap.h"
52 #include "DGtal/io/boards/Board2D.h"
58 using namespace DGtal;
84 board.
saveSVG(
"voronoimap-inputset.svg");
89 NotPredicate notSetPred(set);
94 Voronoi2D voronoimap(
domain,notSetPred,l2);
101 itend = voronoimap.domain().end(); it != itend; ++it)
107 board.
saveSVG(
"voronoimap-voro.svg");
113 itend = voronoimap.domain().end(); it != itend; ++it)
116 unsigned char c = (site[1]*13 + site[0] * 7) % 256;
120 board.
saveSVG(
"voronoimap-cells.svg");
128 Voronoi2D_l8 voronoimap_l8(
domain,notSetPred,l8);
132 itend = voronoimap_l8.domain().end(); it != itend; ++it)
135 unsigned char c = (site[1]*13 + site[0] * 7) % 256;
139 board.
saveSVG(
"voronoimap-vorol8.svg");
152 if ((*it)>maxDT) maxDT = (*it);
159 itend =
dt.domain().end(); it != itend; ++it)
165 board.
saveSVG(
"voronoimap-dt.svg");
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Structure representing an RGB triple with alpha component.
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
void insertNew(const Point &p)
Aim: implements separable l_p metrics with exact predicates.
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
void beginBlock(const std::string &keyword="")
Aim: Implementation of the linear in time Voronoi map construction.
void clear(const DGtal::Color &color=DGtal::Color::None)
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
MyDigitalSurface::ConstIterator ConstIterator
functors namespace gathers all DGtal functors.
DGtal is the top-level namespace which contains all DGtal functions and types.
Custom style class redefining the pen color and the fill color. You may use Board2D::Color::None for ...
Aim: The predicate returns true when the point predicate given at construction return false....
void draw(const Iterator &itb, const Iterator &ite, Board &aBoard)
Vector lower(const Vector &z, unsigned int k)
Vector upper(const Vector &z, unsigned int k)