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;
66 TSpace::Integer t[5] = {0,0,0,0,0};
68 TSpace::Integer t2[5] = {15,15,15,15,15};
70 TSpace::Integer t3[5] = {3,3,3,3,3};
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);
104 <<
": expected="<<norm2<<
" and computed=" 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;
void beginBlock(const std::string &keyword="")
const ConstIterator & end() const
HyperRectDomain< Space > Domain
std::vector< Value >::iterator Iterator
Aim: implements association bewteen points lying in a digital domain and values.
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
functors namespace gathers all DGtal functors.
Aim: implements separable l_p metrics with exact predicates.
Aim: Define a simple Foreground predicate thresholding image values given a single thresold....
const ConstIterator & begin() const
DGtal is the top-level namespace which contains all DGtal functions and types.
ImageContainerBySTLVector< Domain, Value > Image