VAT  3.0
Video Analysis Tool
playerlabelingfrombagoffeatures.h
1 #ifndef PLAYERLABELINGFROMBAGOFFEATURES_H
2 #define PLAYERLABELINGFROMBAGOFFEATURES_H
3 
4 #include <QDomNode>
5 #include <QImage>
6 
7 #include "reliabilitysinglemodelinterface.h"
8 #include "src/blob.h"
9 #include "src/footballConstants.h"
10 
12 {
13 public:
14  PlayerLabelingFromBagOfFeatures(int buffer_size);
15 
17 
18  //IMPLEMENT!! Initializes the model attributes for the interface.
19  //The function is called by the interface constructor
20  virtual void initInstanceAttributes();
21 
22  //IMPLEMENT!! Initializes the dynamics model attributes for the interface.
23  //The function is called by the interface constructor
24  virtual void initDynamicsAttributes();
25 
26  //IMPLEMENT!! Copy function for specific data from the instance (general_copy calls it after copying base info)
27  virtual void copy(SpReliabilitySingleModelInterface);
28 
29  //IMPLEMENT!! Copy general structures and parameters of specific model, without considering instance specific data
30  virtual void copy_structure(SpReliabilitySingleModelInterface);
31 
32  //IMPLEMENT!! sets parameters from xml file
33  virtual void setParameters(QDomNode &i_parameters);
34 
35  //IMPLEMENT!! sets activation criteria for each model: reliability on input (distance, bad data),
36  // needs (occlusion, priority),
37  //sets priority of models (hierarchy).
38  //Checked before update phase
39  virtual void activate(BoundingBox &bb);
40 
41  //IMPLEMENT!! initializes every activated model, according to their own input (region-blob-segments schema)
42  //Executed only once at the begginning of single model creation (after 'copy_structure' and 'copy' methods
43  //are used to copy the information).
44  virtual void init();
45 
46  //IMPLEMENT!! updates activated model instance attributes for current frame, and returns the set of detected/enriched objects.
47  // It notifies if roi (bounding box, or segmentation) changes compared to the input, for reprocessing.
48  virtual bool updateInstance(BoundingBox &, std::set<SpRMMHypothesis, hypothesesOrderedByBestProbabilityOperator> &);
49 
50  //IMPLEMENT!! updates activated model instance attributes for current frame and object, and returns the detected/enriched object.
51  // It notifies if roi (bounding box, or segmentation) changes compared to the input, for reprocessing.
52  // This function does NOT generate mobiles or hypotheses. It processes attributes for the current object.
53  // This function could be used by updateInstance to generate mobile information.
54  virtual void updateSingleInstance(BoundingBox &bb);
55 
56 
57  //IMPLEMENT!! updates model dynamics, based on instances information
58  virtual void updateModelDynamics();
59 
60  //IMPLEMENT!! sets global probability for the model (how good is the model)
61  virtual void setProbabilityAndReliability();
62 
63  //IMPLEMENT!! sets blob enclosing the model in forward process (update)
64  virtual void setForwardInterface();
65 
66  //OPTIONAL
67  virtual bool draw(QPainter &painter);
68 
69  virtual bool draw(QPainter &painter, int r, int g, int b);
70 
71  virtual BoundingBox getEstimator(double &R);
72 
73  ObjectType attributeNameToObjectType(QString s);
74 
75 private:
76 
77  appHistType::iterator itClassHist;
78 
79  double threshold_histogram;
80  double weightCorr;
81  double weightBatha;
82  double weightLuma;
83  double weightChroma;
84  double weightLuv;
85 
86  bool useForegroundMask;
87  bool countAll;
88  bool useClassified;
89  int distType;
90  bool drawFlag;
91  unsigned long showHistogram;
92 
93  std::map< typeCluster, QString > nameFeature;
94 
95 
96  double *countPixelClusterBlob_Chroma(const std::vector<cv::Point> &c,BoundingBox rect, bool useForgroundMask = true, bool countAll = true, int distType = 1, bool useClasdified = true, bool showH = false);
97  double *countPixelClusterBlob_Luv(const std::vector<cv::Point> &c,BoundingBox rect, bool useForgroundMask = true, bool countAll = true, int distType = 1, bool useClasdified = true, bool showH = false);
98  double *countPixelClusterBlob_Luma(const std::vector<cv::Point> &c,BoundingBox rect, bool useForgroundMask = true, bool countAll = true, int distType = 1, bool useClasdified = true, bool showH = false);
99  void calcDistanceAttributes(std::map< typeCluster, double *> blobHistograms, std::map< typeCluster, int> bins, std::map< typeCluster, double > weights, ModelInstanceDataPack &m);
100 
101 };
102 
103 #endif // PLAYERLABELINGFROMBAGOFFEATURES_H
Definition: reliabilitysinglemodelinterface.h:53
Definition: reliabilitysinglemodelinterface.h:96
Definition: playerlabelingfrombagoffeatures.h:11