VAT  3.0
Video Analysis Tool
DeguModelInstance.h
1 #ifndef DEGUMODELINSTAnce_H
2 #define DEGUMODELINSTAnce_H
3 
4 
5 #include <QDomNode>
6 #include <QImage>
7 #include <vector>
8 #include <QSharedPointer>
9 
10 #include "reliabilitysinglemodelinterface.h"
11 #include "src/blob.h"
12 #include "Blob2DFromBGSubstractionModel.h"
13 
14 #include <opencv/cv.h>
15 
16 class Datapool;
17 
18 class DeguModelInstance: public Blob2DFromBGSubstractionModelInstance {
19 public:
20  DeguModelInstance(Datapool *i_data);
21 
23 
24  //Initializes the visible model attributes for the interface.
25  //The function is called by the interface constructor
26  void initAttributes();
27 
28  //sets activation criteria: reliability on input (distance, bad data),
29  // needs (occlusion, priority),
30  //sets priority of models (hierarchy).
31  void setParameters(QDomNode &i_parameters);
32 
33  //sets activation flags for each model, according to the current context
34  void activate(Blob *);
35 
36  //updates the model
37  void update(Blob *);
38 
39  //sets global probability for the model (how good is the model)
40  void setProbability();
41 
42  //sets global reliability for the model (how good is the data used in the model)
43  void setReliability();
44 
45  //sets blob enclosing the model.
46  void setBlobInterface();
47 
48  //sets global probability for the multi-model (how good is the data used in the model)
49  Blob getBlobInterface();
50 
51  //Visualization
52 
53  void printAttributes();
54 
55  void printGeneral();
56 
57  bool draw(QImage *image);
58 
59  //Link to datapool
60  //Datapool *m_data;
61 
62  //Flag for activation according to different criteria
63  bool active;
64 
65  //Global probability and reliability for model
66  double P, R;
67 
68  float Hues[360];
69 
70  std::vector<uchar> pixels;
71 
72 
73  static int getContourToLineIntersection(std::vector<cv::Point> &hull,
74  cv::Point3f &rline,
75  cv::Point2f &r1, cv::Point2f &r2,
76  int *n1 = NULL, int *n2 = NULL);
77 
78  //Fills a segments vector with moving pixel bounds for each normal on the axis
79  void getNormalIntersections(cv::Mat &f, cv::Rect &roi, std::vector<cv::Point> &hull,
80  cv::Point2f &r1, cv::Point2f &r2, int n1, int n2,
81  float dx, float dy, std::vector< segment2D<float> > &segs,
82  std::vector< segment2D<float> > &hull_segs);
83 
84  static bool getGeneralLineForm(cv::Point2f p1, cv::Point2f p2,
85  cv::Point3f &rline);
86  static bool getGeneralLineForm(float x, float y, float dx, float dy,
87  cv::Point3f &rline);
88 
89 
90  //Attributes
91 
92 
93  void checkHistory();
94 
95  void makeHistoryGraph();
96 
97 };
98 
99 
100 
101 
102 #endif // DEGUMODELINSTAnce_H
Definition: geometric.h:103
Definition: DeguModelInstance.h:18
An object of this class is instantiated at main code, and this object is used by every class to push ...
Definition: Datapool.h:39
Definition: blob.h:79