Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal
1.4.0
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
x
Variables
a
d
e
f
h
i
l
n
o
p
t
w
x
Typedefs
a
b
c
d
e
i
k
l
n
o
p
r
s
u
v
z
Enumerations
Enumerator
a
b
c
d
e
g
h
i
j
l
m
n
o
p
s
t
u
v
w
z
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
c
e
f
h
i
l
m
n
o
p
r
s
t
u
Enumerator
a
b
c
d
e
f
g
l
m
o
p
r
s
t
u
v
x
y
z
Related Symbols
a
b
c
d
e
f
g
i
k
l
m
o
p
s
t
u
Examples
►
DGtal
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
testKanungo.cpp
Go to the documentation of this file.
1
31
#include <iostream>
32
#include "DGtal/base/Common.h"
33
#include "DGtal/geometry/volumes/KanungoNoise.h"
34
#include "DGtal/io/boards/Board2D.h"
35
#include "DGtal/helpers/StdDefs.h"
36
#include "DGtal/shapes/Shapes.h"
37
#include "DGtal/kernel/CPointPredicate.h"
39
40
using namespace
std
;
41
using namespace
DGtal
;
42
44
// Functions for testing class Kanungo.
46
50
bool
testKanungo2D
()
51
{
52
unsigned
int
nbok = 0;
53
unsigned
int
nb = 0;
54
55
trace
.
beginBlock
(
"Testing 2DNoise ..."
);
56
57
Z2i::Domain
domain
(
Z2i::Point
(0,0),
Z2i::Point
(128,128));
58
59
Z2i::DigitalSet
set(
domain
);
60
61
Shapes<Z2i::Domain>::addNorm2Ball
( set ,
Z2i::Point
(64,64), 30);
62
63
Board2D
board;
64
board <<
domain
<< set;
65
board.
saveSVG
(
"input-set-kanungo.svg"
);
66
67
board.
clear
();
68
69
//Noisification
70
KanungoNoise<Z2i::DigitalSet, Z2i::Domain>
nosifiedObject(set,
domain
,0.5);
71
board <<
domain
;
72
for
(
Z2i::Domain::ConstIterator
it =
domain
.
begin
(), itend=
domain
.
end
(); it != itend; ++it)
73
if
(nosifiedObject( * it ))
74
board << *it;
75
board.
saveSVG
(
"output-set-kanungo-0.5.svg"
);
76
77
78
board.
clear
();
79
//Noisification
80
KanungoNoise<Z2i::DigitalSet, Z2i::Domain>
nosifiedObject2(set,
domain
,0.1);
81
board <<
domain
;
82
for
(
Z2i::Domain::ConstIterator
it =
domain
.
begin
(), itend=
domain
.
end
(); it != itend; ++it)
83
if
(nosifiedObject2( * it ))
84
board << *it;
85
board.
saveSVG
(
"output-set-kanungo-0.1.svg"
);
86
87
nbok ++;
88
nb++;
89
trace
.
info
() <<
"("
<< nbok <<
"/"
<< nb <<
") "
90
<<
"true == true"
<< std::endl;
91
trace
.
endBlock
();
92
93
return
nbok == nb;
94
}
50
bool
testKanungo2D
() {
…
}
95
96
bool
CheckingConcept
()
97
{
98
BOOST_CONCEPT_ASSERT((
concepts::CPointPredicate
<
KanungoNoise<Z2i::DigitalSet, Z2i::Domain>
> ));
99
return
true
;
100
}
96
bool
CheckingConcept
() {
…
}
101
102
104
// Standard services - public :
105
106
int
main
(
int
argc,
char
** argv )
107
{
108
trace
.
beginBlock
(
"Testing class Kanungo"
);
109
trace
.
info
() <<
"Args:"
;
110
for
(
int
i = 0; i < argc; ++i )
111
trace
.
info
() <<
" "
<< argv[ i ];
112
trace
.
info
() << endl;
113
114
bool
res =
CheckingConcept
() &&
testKanungo2D
();
// && ... other tests
115
trace
.
emphase
() << ( res ?
"Passed."
:
"Error."
) << endl;
116
trace
.
endBlock
();
117
return
res ? 0 : 1;
118
}
106
int
main
(
int
argc,
char
** argv ) {
…
}
119
// //
DGtal::Board2D
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition
Board2D.h:71
DGtal::DigitalSetByAssociativeContainer
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Definition
DigitalSetByAssociativeContainer.h:90
DGtal::HyperRectDomain_Iterator
Iterator for HyperRectDomain.
Definition
HyperRectDomain_Iterator.h:154
DGtal::HyperRectDomain< Space >
DGtal::HyperRectDomain::begin
const ConstIterator & begin() const
Definition
HyperRectDomain.h:176
DGtal::HyperRectDomain::end
const ConstIterator & end() const
Definition
HyperRectDomain.h:201
DGtal::KanungoNoise
Aim: From a point predicate (model of concepts::CPointPredicate), this class constructs another point...
Definition
KanungoNoise.h:85
DGtal::PointVector< dim, Integer >
DGtal::Shapes::addNorm2Ball
static void addNorm2Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::emphase
std::ostream & emphase()
DGtal::Trace::info
std::ostream & info()
DGtal::Trace::endBlock
double endBlock()
LibBoard::Board::clear
void clear(const DGtal::Color &color=DGtal::Color::None)
Definition
Board.cpp:151
LibBoard::Board::saveSVG
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition
Board.cpp:1011
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
Definition
Common.h:153
std
STL namespace.
DGtal::concepts::CPointPredicate
Aim: Defines a predicate on a point.
Definition
CPointPredicate.h:81
main
int main()
Definition
testBits.cpp:56
testKanungo2D
bool testKanungo2D()
Definition
testKanungo.cpp:50
CheckingConcept
bool CheckingConcept()
Definition
testKanungo.cpp:96
domain
Domain domain
Definition
testProjection.cpp:88
tests
geometry
volumes
testKanungo.cpp
Generated on Mon Jun 10 2024 17:36:11 for DGtal by
1.11.0