MTF
LieHomography.h
1 #ifndef MTF_LIE_HOMOGRAPHY_H
2 #define MTF_LIE_HOMOGRAPHY_H
3 
4 #include "ProjectiveBase.h"
5 
6 _MTF_BEGIN_NAMESPACE
7 
9  bool normalized_init;
10  double grad_eps;
11  bool debug_mode;
13  LieHomographyParams(const SSMParams *ssm_params,
14  bool _normalized_init, double _grad_eps,
15  bool _debug_mode);
17  LieHomographyParams(const LieHomographyParams *params = nullptr);
18 };
19 
21 public:
22 
24  using StateSpaceModel::setCorners;
25 
26  LieHomography( const ParamType *params_in = nullptr);
27 
28  void setCorners(const Matrix24d &corners) override;
29  void compositionalUpdate(const VectorXd& state_update) override;
30 
31  void getInitPixGrad(Matrix2Xd &ssm_grad, int pix_id) override;
32  void getCurrPixGrad(Matrix2Xd &ssm_grad, int pix_id) override;
33 
34  void cmptInitPixJacobian(MatrixXd &jacobian_prod, const PixGradT &pix_jacobian) override;
35  void cmptWarpedPixJacobian(MatrixXd &dI_dp, const PixGradT &dI_dw) override;
36  void cmptPixJacobian(MatrixXd &jacobian_prod, const PixGradT &pix_jacobian) override;
37  void cmptApproxPixJacobian(MatrixXd &jacobian_prod,
38  const PixGradT &pix_jacobian) override;
39 
40  void estimateWarpFromCorners(VectorXd &state_update, const Matrix24d &in_corners,
41  const Matrix24d &out_corners) override;
42 
43  void estimateWarpFromPts(VectorXd &state_update, vector<uchar> &mask,
44  const vector<cv::Point2f> &in_pts, const vector<cv::Point2f> &out_pts,
45  const EstimatorParams &est_params) override;
46 
47  void invertState(VectorXd& inv_state, const VectorXd& state) override{
48  inv_state = -state;
49  }
50  void cmptInitPixHessian(MatrixXd &pix_hess_ssm, const PixHessT &pix_hess_coord,
51  const PixGradT &pix_grad) override;
52 
53  void getWarpFromState(Matrix3d &warp_mat, const VectorXd& ssm_state) override;
54  void getStateFromWarp(VectorXd &state_vec, const Matrix3d& warp_mat) override;
55 
56 private:
57  ParamType params;
58 
59  Matrix3d lieAlgBasis[8];
60  RowVector3d zero_vec;
61  Matrix3d lie_alg_mat;
62 
63  void computeJacobian(MatrixXd &jacobian, Matrix3Xd &basis_pts_hm);
64 
65 };
66 
67 _MTF_END_NAMESPACE
68 
69 #endif
Definition: LieHomography.h:8
Definition: LieHomography.h:20
Definition: StateSpaceModel.h:35
Definition: SSMEstimatorParams.h:9
base class for all SSMs that can be expressed by homogeneous multiplication with a 3x3 projective tra...
Definition: ProjectiveBase.h:14
LieHomographyParams(const SSMParams *ssm_params, bool _normalized_init, double _grad_eps, bool _debug_mode)
value constructor