DGtal
1.4.2
|
#include <iostream>
#include <iomanip>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/io/colormaps/GrayscaleColorMap.h"
#include "DGtal/io/colormaps/HueShadeColorMap.h"
#include "DGtal/io/colormaps/TickedColorMap.h"
#include "DGtal/io/colormaps/GradientColorMap.h"
#include "DGtal/io/boards/Board2D.h"
#include "DGtal/images/ImageSelector.h"
#include "DGtal/images/SimpleThresholdForegroundPredicate.h"
#include "DGtal/geometry/volumes/distance/DistanceTransformation.h"
Go to the source code of this file.
Functions | |
template<typename Image > | |
void | randomSeeds (Image &image, const unsigned int nb, const int value) |
int | main () |
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
An example file named distancetransform2D. The aim of this example is to demonstrate the distance transformation package of the DGtal library. Using a simple random seed example, we compute the distance transformation (linear in time algorithm) using the L1, Linfinity and L2 metrics.
This file is part of the DGtal library.
Definition in file distancetransform2D.cpp.
int main | ( | void | ) |
[DTDef]
[DTDef]
[DTPredicate]
[DTPredicate]
[DTCompute]
[DTCompute]
[DTColormaps]
[DTColormaps]
Definition at line 88 of file distancetransform2D.cpp.
References DGtal::TickedColorMap< TValue, TColorMap >::addRegularTicks(), DGtal::Trace::beginBlock(), LibBoard::Board::clear(), DGtal::TickedColorMap< TValue, TColorMap >::colormap(), DGtal::Trace::endBlock(), DGtal::TickedColorMap< TValue, TColorMap >::finalize(), image(), randomSeeds(), LibBoard::Board::saveSVG(), LibBoard::Board::setUnit(), DGtal::trace, LibBoard::Board::UCentimeter, and DGtal::Trace::warning().
void randomSeeds | ( | Image & | image, |
const unsigned int | nb, | ||
const int | value | ||
) |
Set to a given value a random set of nb points.
image | the image |
nb | the number of random points to insert |
value | the value to add at each random point |
Definition at line 72 of file distancetransform2D.cpp.
References dim().
Referenced by main().