ProjectiveGT.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5  TerraLib is free software: you can redistribute it and/or modify
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19
20 /*!
21  \file terralib/geometry/ProjectiveGT.h
22
23  \brief 2D Projective Geometric transformation.
24 */
25
26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_PROJECTIVEGT_H
27 #define __TERRALIB_GEOMETRY_INTERNAL_PROJECTIVEGT_H
28
29 // TerraLib
30 #include "Config.h"
32
33 // Boost
34 #include <boost/concept_check.hpp>
35 #include <boost/numeric/ublas/matrix.hpp>
36
37 namespace te
38 {
39  namespace gm
40  {
41  /*!
42  \class ProjectiveGT
43
44  \brief 2D Projective Geometric transformation.
45
46  \note The transformation parameters (inside GTParameters::m_directParameters) are disposed on the following form:
47
48  \code
49  | u | | a b c | * | x |
50  | v | = | d e f | | y |
51  | 1 | | g h 1 | | 1 |
52
53  u = a.x + b.y + c
54  -------------------
55  g.x + h.y + 1
56
57  v = d.x + e.y + f
58  -------------------
59  g.x + h.y + 1
60
61  |u0| |x0 y0 1 0 0 0 -x0*u0 -y0*v0|.|a|
62  |v0| |0 0 0 x0 y0 1 -x0*v0 -y0*v0| |b|
63  |u1| |...................................| |c|
64  |v1| = |...................................| |d|
65  |..| |...................................| |e|
66  |..| |...................................| |f|
67  |..| |...................................| |g|
68  |..| |...................................| |h|
69
70  GTParameters::m_directParameters = [ a b c d e f g h ]
71  \endcode
72  */
74  {
75  public:
76
77  /*! \brief Default constructor. */
78  ProjectiveGT();
79
80  /*! \brief Destructor. */
81  ~ProjectiveGT();
82
83  const std::string& getName() const;
84
85  bool isValid( const GTParameters& params ) const;
86
87  void directMap( const GTParameters& params, const double& pt1X,
88  const double& pt1Y, double& pt2X, double& pt2Y ) const;
89
90  void inverseMap( const GTParameters& params, const double& pt2X,
91  const double& pt2Y, double& pt1X, double& pt1Y ) const;
92
93  unsigned int getMinRequiredTiePoints() const;
94
95  GeometricTransformation* clone() const;
96
97  protected:
98
99  // Variables used by method computeParameters
100  mutable unsigned int m_computeParameters_tiepointsSize;
101  mutable unsigned int m_computeParameters_index1;
102  mutable unsigned int m_computeParameters_index2;
103  mutable unsigned int m_computeParameters_blockOffset;
104  mutable boost::numeric::ublas::matrix< double > m_computeParameters_L_DM;
105  mutable boost::numeric::ublas::matrix< double > m_computeParameters_A_DM;
106  mutable boost::numeric::ublas::matrix< double > m_computeParameters_L_IM;
107  mutable boost::numeric::ublas::matrix< double > m_computeParameters_A_IM;
108  mutable boost::numeric::ublas::matrix< double > m_computeParameters_A_DM_t;
109  mutable boost::numeric::ublas::matrix< double > m_computeParameters_A_IM_t;
110  mutable boost::numeric::ublas::matrix< double > m_computeParameters_N_DM;
111  mutable boost::numeric::ublas::matrix< double > m_computeParameters_N_IM;
112  mutable boost::numeric::ublas::matrix< double > m_computeParameters_U_DM;
113  mutable boost::numeric::ublas::matrix< double > m_computeParameters_U_IM;
114  mutable boost::numeric::ublas::matrix< double > m_computeParameters_N_DM_inv;
115  mutable boost::numeric::ublas::matrix< double > m_computeParameters_N_IM_inv;
116  mutable boost::numeric::ublas::matrix< double > m_computeParameters_X_DM;
117  mutable boost::numeric::ublas::matrix< double > m_computeParameters_X_IM;
118
119  bool computeParameters( GTParameters& params ) const;
120  };
121
122  } // end namespace gm
123 } // end namespace te
124
125 #endif // __TERRALIB_GEOMETRY_INTERNAL_PROJECTIVEGT_H
126
boost::numeric::ublas::matrix< double > m_computeParameters_X_IM
Definition: ProjectiveGT.h:117
boost::numeric::ublas::matrix< double > m_computeParameters_A_DM
Definition: ProjectiveGT.h:105
boost::numeric::ublas::matrix< double > m_computeParameters_A_IM
Definition: ProjectiveGT.h:107
2D Geometric transformation base class.
boost::numeric::ublas::matrix< double > m_computeParameters_U_DM
Definition: ProjectiveGT.h:112
boost::numeric::ublas::matrix< double > m_computeParameters_N_DM_inv
Definition: ProjectiveGT.h:114
2D Geometric transformation base class.
boost::numeric::ublas::matrix< double > m_computeParameters_N_DM
Definition: ProjectiveGT.h:110
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:76
boost::numeric::ublas::matrix< double > m_computeParameters_X_DM
Definition: ProjectiveGT.h:116
unsigned int m_computeParameters_tiepointsSize
Definition: ProjectiveGT.h:100
2D Projective Geometric transformation.
Definition: ProjectiveGT.h:73
URI C++ Library.
boost::numeric::ublas::matrix< double > m_computeParameters_L_DM
Definition: ProjectiveGT.h:104
unsigned int m_computeParameters_blockOffset
Definition: ProjectiveGT.h:103
boost::numeric::ublas::matrix< double > m_computeParameters_N_IM
Definition: ProjectiveGT.h:111
unsigned int m_computeParameters_index1
Definition: ProjectiveGT.h:101
boost::numeric::ublas::matrix< double > m_computeParameters_U_IM
Definition: ProjectiveGT.h:113
boost::numeric::ublas::matrix< double > m_computeParameters_A_IM_t
Definition: ProjectiveGT.h:109
boost::numeric::ublas::matrix< double > m_computeParameters_A_DM_t
Definition: ProjectiveGT.h:108
unsigned int m_computeParameters_index2
Definition: ProjectiveGT.h:102
2D Geometric transformation parameters.
Definition: GTParameters.h:50
boost::numeric::ublas::matrix< double > m_computeParameters_L_IM
Definition: ProjectiveGT.h:106
Configuration flags for the Vector Geometry Model of TerraLib.
boost::numeric::ublas::matrix< double > m_computeParameters_N_IM_inv
Definition: ProjectiveGT.h:115