Structural deformable models
Main Page
Namespaces
Classes
Files
File List
File Members
src
main.cpp
Go to the documentation of this file.
1
#include <fx.h>
2
#include <iostream>
3
#include "
common.h
"
4
#include "
Data.h
"
5
#include "
ExpMap.h
"
6
#include "
Searcher.h
"
7
using namespace
std
;
8
9
bool
setTitle
(
const
char
* title) {
10
cout <<
"Title: "
<< title << endl;
11
return
true
;
12
}
13
14
bool
setStatusText
(
const
char
* stext) {
15
cout <<
"Status: "
<< stext << endl;
16
return
true
;
17
}
18
19
int
main
(
int
argc,
char
**argv)
20
{
21
// Make application
22
FXApp application(
"Deformable Model Segmentation"
,
"FoxText"
);
23
// Start app
24
application.init(argc,argv);
25
26
Dataset
data(
"freerect.tif"
);
27
Model
model(&data);
28
model.
readFile
(
"quadc.dm"
);
29
Searcher
m_Search;
30
//setup searcher
31
{
32
ExpectationMap
em(model);
33
PropVec
propl(0.), propu(0.);
34
Point2D
dims((
float
)data.
getDim1Size
(),
35
(float)data.
getDim2Size
());
36
Model::setPropPos
(propu, dims);
37
Model::setPropScale
(propu, 4);
38
Model::setPropDir
(propu, 2*
M_PI
);
39
Model::setPropScale
(propl, 0.1);
40
em.
setLB
(propl);
41
em.
setUB
(propu);
42
cout <<
"propl="
<<propl<<endl;
43
cout <<
"propu="
<<propu<<endl;
44
cout << em.
updateIntegral
() << endl;
45
EMDRect
* rd =
new
EMDRect
(propl,propu);
46
PropVec
propc((propl+propu)*0.5);
47
PropVec
propd(propc-propl);
48
EMDGauss
gd(propc,propd);
49
em.
add
(rd);
50
cout << em.
updateIntegral
() << endl;
51
cout <<
"rdv="
<< em.
getPropVec
() << endl;
52
cout << rd->
ratePropVec
(propl) << endl;
53
cout << rd->
ratePropVec
(propl-propl) << endl;
54
DUMP
(gd.
ratePropVec
(propc));
55
DUMP
(gd.
ratePropVec
(propc+propd));
56
DUMP
(gd.
ratePropVec
(propc+(propd*3)));
57
m_Search.
setExpectationMap
(em);
58
cout <<
"------------"
<< endl;
59
DUMP
(model.
getProperties
());
60
Model
*gm = em.
generateInstance
();
61
DUMP
(gm->getStdRadius());
62
DUMP
(gm->getProperties());
63
}
64
65
return
0;
66
}
ExpMap.h
DUMP
#define DUMP(expr)
Definition:
common.h:16
Searcher::setExpectationMap
void setExpectationMap(const ExpectationMap &em)
Definition:
Searcher.cpp:346
Dataset::getDim1Size
int getDim1Size() const
Definition:
Data.h:44
EMDGauss::ratePropVec
float ratePropVec(const PropVec &prop, Winner *winner=NULL) const
Definition:
ExpMap.cpp:230
Model::getProperties
const PropVec & getProperties() const
Definition:
Model.cpp:1263
main
int main(int argc, char **argv)
Definition:
main.cpp:19
EMDGauss
Definition:
ExpMap.h:93
ExpectationMap::generateInstance
Model * generateInstance() const
Definition:
ExpMap.cpp:184
Searcher.h
setTitle
bool setTitle(const char *title)
Definition:
main.cpp:9
std
STL namespace.
Data.h
ExpectationMap::add
void add(EMDistribution *ed)
Definition:
ExpMap.cpp:23
setPropDir
PropVec & setPropDir(PropVec &prop, float dir)
Definition:
PropVec.h:28
setPropPos
PropVec & setPropPos(PropVec &prop, const Point2D &p)
Definition:
PropVec.h:16
EMDRect::setUB
void setUB(const PropVec &ub)
Definition:
ExpMap.h:87
EMDRect
Definition:
ExpMap.h:73
Dataset::getDim2Size
int getDim2Size() const
Definition:
Data.h:45
setStatusText
bool setStatusText(const char *stext)
Definition:
main.cpp:14
M_PI
#define M_PI
Definition:
mathutil.h:9
Model
Definition:
Model.h:33
ExpectationMap
Definition:
ExpMap.h:142
VVector< float, 4 >
ExpectationMap::updateIntegral
float updateIntegral()
Definition:
ExpMap.cpp:167
Dataset
Definition:
Data.h:21
ExpectationMap::getPropVec
virtual PropVec getPropVec() const
Definition:
ExpMap.cpp:86
Searcher
Definition:
Searcher.h:16
common.h
Model::readFile
bool readFile(const char *filename, bool fullread=true)
Definition:
Model.cpp:365
Point2D
Definition:
Point.h:16
setPropScale
PropVec & setPropScale(PropVec &prop, float pscale)
Definition:
PropVec.h:22
EMDRect::setLB
void setLB(const PropVec &lb)
Definition:
ExpMap.h:88
EMDRect::ratePropVec
float ratePropVec(const PropVec &prop, Winner *winner=NULL) const
Definition:
ExpMap.cpp:213
Generated by
1.8.11