OTB  9.0.0
Orfeo Toolbox
otbLeastSquareAffineTransformEstimator.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbLeastSquareAffineTransformEstimator_h
22 #define otbLeastSquareAffineTransformEstimator_h
23 
24 #include "itkObject.h"
25 #include "itkObjectFactory.h"
26 #include "itkMatrix.h"
27 #include "itkVector.h"
28 #include "itkAffineTransform.h"
29 
30 namespace otb
31 {
32 
68 template <class TPoint>
69 class ITK_EXPORT LeastSquareAffineTransformEstimator : public itk::Object
70 {
71 public:
74  typedef itk::Object Superclass;
75  typedef itk::SmartPointer<Self> Pointer;
76  typedef itk::SmartPointer<const Self> ConstPointer;
77 
79  itkNewMacro(Self);
80 
82  itkTypeMacro(LeastSquareAffineTransformEstimator, Object);
83 
85  itkStaticConstMacro(PointDimension, unsigned int, TPoint::PointDimension);
86 
88  typedef TPoint PointType;
89  typedef typename PointType::CoordRepType PrecisionType;
90  typedef itk::CovariantVector<PrecisionType, PointDimension> CovariantVectorType;
91  typedef std::pair<PointType, PointType> TiePointsType;
92  typedef std::vector<TiePointsType> TiePointsContainerType;
93 
95  typedef itk::Matrix<PrecisionType, PointDimension, PointDimension> MatrixType;
96  typedef itk::Vector<PrecisionType, PointDimension> VectorType;
97  typedef itk::AffineTransform<PrecisionType, PointDimension> AffineTransformType;
98  typedef typename AffineTransformType::Pointer AffineTransformPointerType;
99 
101  itkGetConstReferenceMacro(Matrix, MatrixType);
102 
104  itkGetConstReferenceMacro(Offset, VectorType);
105 
107  itkGetObjectMacro(AffineTransform, AffineTransformType);
108 
110  itkGetConstReferenceMacro(RMSError, CovariantVectorType);
111 
113  itkGetConstReferenceMacro(RelativeResidual, CovariantVectorType);
114 
117  TiePointsContainerType& GetTiePointsContainer();
118 
120  void SetTiePointsContainer(const TiePointsContainerType& container);
121 
123  void AddTiePoints(const PointType& src, const PointType& dst);
124 
126  void ClearTiePoints();
127 
129  void Compute();
130 
131 protected:
134 
137 
139  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
140 
141 private:
142  LeastSquareAffineTransformEstimator(const Self&) = delete;
143  void operator=(const Self&) = delete;
144 
147 
150 
153 
156 
159 
162 
163 }; // end of class
164 
165 } // end of namespace otb
166 
167 #ifndef OTB_MANUAL_INSTANTIATION
169 #endif
170 
171 #endif
otb::LeastSquareAffineTransformEstimator::CovariantVectorType
itk::CovariantVector< PrecisionType, PointDimension > CovariantVectorType
Definition: otbLeastSquareAffineTransformEstimator.h:90
otb::LeastSquareAffineTransformEstimator::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbLeastSquareAffineTransformEstimator.h:76
otb::LeastSquareAffineTransformEstimator::m_Matrix
MatrixType m_Matrix
Definition: otbLeastSquareAffineTransformEstimator.h:155
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::LeastSquareAffineTransformEstimator::PrecisionType
PointType::CoordRepType PrecisionType
Definition: otbLeastSquareAffineTransformEstimator.h:89
otb::LeastSquareAffineTransformEstimator::m_AffineTransform
AffineTransformPointerType m_AffineTransform
Definition: otbLeastSquareAffineTransformEstimator.h:161
otb::LeastSquareAffineTransformEstimator::Self
LeastSquareAffineTransformEstimator Self
Definition: otbLeastSquareAffineTransformEstimator.h:73
otb::LeastSquareAffineTransformEstimator::m_Offset
VectorType m_Offset
Definition: otbLeastSquareAffineTransformEstimator.h:158
otb::LeastSquareAffineTransformEstimator::TiePointsType
std::pair< PointType, PointType > TiePointsType
Definition: otbLeastSquareAffineTransformEstimator.h:91
otbLeastSquareAffineTransformEstimator.hxx
otb::LeastSquareAffineTransformEstimator::AffineTransformType
itk::AffineTransform< PrecisionType, PointDimension > AffineTransformType
Definition: otbLeastSquareAffineTransformEstimator.h:97
otb::LeastSquareAffineTransformEstimator::MatrixType
itk::Matrix< PrecisionType, PointDimension, PointDimension > MatrixType
Definition: otbLeastSquareAffineTransformEstimator.h:95
otb::LeastSquareAffineTransformEstimator::TiePointsContainerType
std::vector< TiePointsType > TiePointsContainerType
Definition: otbLeastSquareAffineTransformEstimator.h:92
otb::LeastSquareAffineTransformEstimator::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbLeastSquareAffineTransformEstimator.h:75
otb::LeastSquareAffineTransformEstimator::Superclass
itk::Object Superclass
Definition: otbLeastSquareAffineTransformEstimator.h:74
otb::LeastSquareAffineTransformEstimator::VectorType
itk::Vector< PrecisionType, PointDimension > VectorType
Definition: otbLeastSquareAffineTransformEstimator.h:96
otb::LeastSquareAffineTransformEstimator::m_TiePointsContainer
TiePointsContainerType m_TiePointsContainer
Definition: otbLeastSquareAffineTransformEstimator.h:146
otb::LeastSquareAffineTransformEstimator
This class provide the affine transform LSQR estimation.
Definition: otbLeastSquareAffineTransformEstimator.h:69
otb::LeastSquareAffineTransformEstimator::AffineTransformPointerType
AffineTransformType::Pointer AffineTransformPointerType
Definition: otbLeastSquareAffineTransformEstimator.h:98
otb::LeastSquareAffineTransformEstimator::m_RMSError
CovariantVectorType m_RMSError
Definition: otbLeastSquareAffineTransformEstimator.h:149
otb::LeastSquareAffineTransformEstimator::PointType
TPoint PointType
Definition: otbLeastSquareAffineTransformEstimator.h:88
otb::LeastSquareAffineTransformEstimator::m_RelativeResidual
CovariantVectorType m_RelativeResidual
Definition: otbLeastSquareAffineTransformEstimator.h:152