ibg_cv.h
Go to the documentation of this file.
1 #ifndef VTEC_CV_WRAPPER_IBG_CV_HEADER
2 #define VTEC_CV_WRAPPER_IBG_CV_HEADER
3 
5 #include <homography_optimizer/ibg_interface.h>
6 #include <homography_optimizer/types.h>
7 #include <cv_bridge/cv_bridge.h>
8 
9 namespace VTEC
10 {
12 {
13 public:
19 
27  virtual void initialize(const int max_nb_iter, const int max_nb_pyr_level, const double sampling_rate) = 0;
28 
40  bool setReferenceTemplate(const cv::Mat& ref_image, const int posx, const int posy, const int sizex, const int sizey);
41 
53  double optimize(const cv::Mat& curr_image, cv::Mat& H, float& alpha, float& beta, int predictor);
54 
60  std::vector<int> getNbIterations();
61 
67  std::vector<cv::Mat> getHomographySequence();
68 
74  void getCurrentTemplate(cv::Mat& img);
75 
81  void getReferenceTemplate(cv::Mat& img);
82 
88  void setHomography(const cv::Mat H);
89 
95  void getHomography(cv::Mat& H);
96 
97 protected:
98  IBGHomographyOptimizer* optimizer;
99 
101 
102 }; /* class IBGHomographyOptimizerCvWrapper */
103 
105 {
106 public:
108  {
109  }
110 
111  void initialize(const int max_nb_iter, const int max_nb_pyr_level, const double sampling_rate)
112  {
113  optimizer = new IBGFullHomographyOptimizer();
114  optimizer->initialize(max_nb_iter, max_nb_pyr_level, sampling_rate);
115  initialized_ = true;
116  }
117 
118 }; /* class IBGFullHomographyOptimizerCvWrapper */
119 
121 {
122 public:
124  {
125  }
126 
127  void initialize(const int max_nb_iter, const int max_nb_pyr_level, const double sampling_rate)
128  {
129  optimizer = new IBGAffineHomographyOptimizer();
130  optimizer->initialize(max_nb_iter, max_nb_pyr_level, sampling_rate);
131  initialized_ = true;
132  }
133 
134 }; /* class IBGAffineHomographyOptimizerCvWrapper */
135 
137 {
138 public:
140  {
141  }
142 
143  void initialize(const int max_nb_iter, const int max_nb_pyr_level, const double sampling_rate)
144  {
145  optimizer = new IBGStretchHomographyOptimizer();
146  optimizer->initialize(max_nb_iter, max_nb_pyr_level, sampling_rate);
147  initialized_ = true;
148  }
149 
150 }; /* class IBGStretchHomographyOptimizerCvWrapper */
151 } /* namespace VTEC */
152 
153 #endif /* VTEC_CV_WRAPPER_IBG_CV_HEADER */
Class for FULL homography optimizer interface. 8 degrees of freedom in the homography.
void getCurrentTemplate(cv::Mat &img)
Gets the current template.
Definition: ibg_cv.cpp:99
IBGHomographyOptimizer * optimizer
Definition: ibg_cv.h:98
virtual void initialize(const int max_nb_iter, const int max_nb_pyr_level, const double sampling_rate)=0
Initiliazation of the optimizer.
bool setReferenceTemplate(const cv::Mat &ref_image, const int posx, const int posy, const int sizex, const int sizey)
Sets the reference template.
Definition: ibg_cv.cpp:11
void initialize(const int max_nb_iter, const int max_nb_pyr_level, const double sampling_rate)
Initiliazation of the optimizer.
Definition: ibg_cv.h:143
double optimize(const cv::Mat &curr_image, cv::Mat &H, float &alpha, float &beta, int predictor)
Optimization function.
Definition: ibg_cv.cpp:24
IBGHomographyOptimizerCvWrapper()
Constructor.
Definition: ibg_cv.cpp:6
void getReferenceTemplate(cv::Mat &img)
Gets the reference template.
Definition: ibg_cv.cpp:106
void setHomography(const cv::Mat H)
Sets the homography.
Definition: ibg_cv.cpp:92
void initialize(const int max_nb_iter, const int max_nb_pyr_level, const double sampling_rate)
Initiliazation of the optimizer.
Definition: ibg_cv.h:111
std::vector< cv::Mat > getHomographySequence()
Gets the homography sequence.
Definition: ibg_cv.cpp:74
Definition: draw.h:3
void getHomography(cv::Mat &H)
Gets the homography.
Definition: ibg_cv.cpp:113
std::vector< int > getNbIterations()
Gets the number of iterations.
Definition: ibg_cv.cpp:61
void initialize(const int max_nb_iter, const int max_nb_pyr_level, const double sampling_rate)
Initiliazation of the optimizer.
Definition: ibg_cv.h:127


cv_wrapper
Author(s):
autogenerated on Sun Dec 16 2018 03:14:36