32 #include "DGtal/base/Common.h"
33 #include "DGtal/base/Common.h"
34 #include "DGtal/kernel/SpaceND.h"
35 #include "DGtal/kernel/domains/HyperRectDomain.h"
36 #include "DGtal/images/ImageSelector.h"
37 #include "DGtal/geometry/volumes/distance/ExactPredicateLpSeparableMetric.h"
38 #include "DGtal/geometry/volumes/distance/DistanceTransformation.h"
39 #include "DGtal/io/colormaps/HueShadeColorMap.h"
40 #include "DGtal/io/colormaps/GrayscaleColorMap.h"
41 #include "DGtal/io/boards/Board2D.h"
42 #include "DGtal/images/SimpleThresholdForegroundPredicate.h"
46 using namespace DGtal;
58 unsigned int nbok = 0;
79 for (
Image::Iterator it=image.begin(),itend=image.end(); it!=itend; ++it)
81 image.setValue( c , 0 );
84 Predicate aPredicate(image,0);
93 itDom != itDomend; ++itDom)
97 L2Metric::RawValue norm2=0;
98 for(Point::Iterator itd=d.begin(), itdend=d.end(); itd!=itdend; ++itd)
99 norm2+= (*itd)*(*itd);
101 if (
dt.metric()->rawDistance( (*itDom),
dt.getVoronoiSite(*itDom) ) != norm2)
104 <<
": expected="<<norm2<<
" and computed="
105 <<
dt.metric()->rawDistance( (*itDom),
dt.getVoronoiSite(*itDom) )
112 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
113 <<
"true == true" << std::endl;
122 int main(
int argc,
char** argv )
126 for (
int i = 0; i < argc; ++i )
131 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Aim: implements separable l_p metrics with exact predicates.
Iterator for HyperRectDomain.
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
const ConstIterator & end() const
const ConstIterator & begin() const
std::vector< Value >::iterator Iterator
Aim: implements association bewteen points lying in a digital domain and values.
void beginBlock(const std::string &keyword="")
Aim: Define a simple Foreground predicate thresholding image values given a single thresold....
Point::Coordinate Integer
functors namespace gathers all DGtal functors.
DGtal is the top-level namespace which contains all DGtal functions and types.
ImageContainerBySTLVector< Domain, Value > Image
HyperRectDomain< Space > Domain