21 #ifndef otbLeastSquareBilinearTransformEstimator_hxx
22 #define otbLeastSquareBilinearTransformEstimator_hxx
24 #include <vnl/algo/vnl_lsqr.h>
25 #include <vnl/vnl_sparse_matrix_linear_system.h>
26 #include <vnl/vnl_least_squares_function.h>
27 #include <vnl/vnl_inverse.h>
28 #include <vnl/vnl_matrix.h>
36 template <
class TPo
int>
38 : m_TiePointsContainer(), m_RMSError(), m_RelativeResidual(), bl_a(0.0), bl_b(0.0), bl_c(0.0), bl_d(0.0), Ata(), Atb()
44 template <
class TPo
int>
48 m_TiePointsContainer.clear();
51 template <
class TPo
int>
54 vnl_matrix_fixed<double, 4, 1> Ata_layer;
56 Ata_layer(1,0) = src[0];
57 Ata_layer(2,0) = src[1];
58 Ata_layer(3,0) = src[0] * src[1];
60 Ata += Ata_layer * Ata_layer.transpose();
61 Atb += Ata_layer * dst;
67 template <
class TPo
int>
70 vnl_matrix_fixed<double, 4, 1> soln;
72 vnl_matrix<double> inv;
73 vnl_matrix_fixed<double, 4, 4> inv2;
74 vnl_matrix_fixed<double, 4, 4> id;
77 inv = vnl_matrix_inverse<double>(Ata);
78 inv2 = vnl_matrix_fixed<double, 4, 4>(inv);
79 soln = vnl_matrix_fixed<double, 4, 4>(vnl_matrix_inverse<double>(Ata)) * Atb;
89 template <
class TPo
int>
92 dst = (bl_a + bl_b*point[0] + bl_c*point[1] + bl_d*point[0]*point[1]);
95 template <
class TPo
int>
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.