Structural deformable models
Functions
main.cpp File Reference
#include <fx.h>
#include <iostream>
#include "common.h"
#include "Data.h"
#include "ExpMap.h"
#include "Searcher.h"
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

bool setTitle (const char *title)
 
bool setStatusText (const char *stext)
 
int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 19 of file main.cpp.

References ExpectationMap::add(), DUMP, ExpectationMap::generateInstance(), Dataset::getDim1Size(), Dataset::getDim2Size(), Model::getProperties(), ExpectationMap::getPropVec(), M_PI, EMDRect::ratePropVec(), EMDGauss::ratePropVec(), Model::readFile(), Searcher::setExpectationMap(), EMDRect::setLB(), setPropDir(), setPropPos(), setPropScale(), EMDRect::setUB(), and ExpectationMap::updateIntegral().

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 }
#define DUMP(expr)
Definition: common.h:16
void setExpectationMap(const ExpectationMap &em)
Definition: Searcher.cpp:346
PropVec & setPropDir(PropVec &prop, float dir)
Definition: PropVec.h:28
PropVec & setPropPos(PropVec &prop, const Point2D &p)
Definition: PropVec.h:16
Definition: ExpMap.h:73
#define M_PI
Definition: mathutil.h:9
Definition: Model.h:33
Definition: Data.h:21
Definition: Point.h:16
PropVec & setPropScale(PropVec &prop, float pscale)
Definition: PropVec.h:22
float ratePropVec(const PropVec &prop, Winner *winner=NULL) const
Definition: ExpMap.cpp:213
bool setStatusText ( const char *  stext)

Definition at line 14 of file main.cpp.

14  {
15  cout << "Status: " << stext << endl;
16  return true;
17 }
bool setTitle ( const char *  title)

Definition at line 9 of file main.cpp.

9  {
10  cout << "Title: " << title << endl;
11  return true;
12 }