OTB  10.0.0
Orfeo Toolbox
otbLeastSquareAffineTransformEstimator.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 
102 
105 
107  itkGetConstReferenceMacro(Matrix, MatrixType);
108 
110  itkGetConstReferenceMacro(Offset, VectorType);
111 
114 
116  itkGetConstReferenceMacro(RMSError, CovariantVectorType);
117 
119  itkGetConstReferenceMacro(RelativeResidual, CovariantVectorType);
120 
123  TiePointsContainerType& GetTiePointsContainer();
124 
126  void SetTiePointsContainer(const TiePointsContainerType& container);
127 
129  void AddTiePoints(const PointType& src, const PointType& dst);
130 
132  void ClearTiePoints();
133 
135  void Compute();
136 
137 protected:
139  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
140 
141 private:
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
This class provide the affine transform LSQR estimation.
itkGetObjectMacro(AffineTransform, AffineTransformType)
itk::AffineTransform< PrecisionType, PointDimension > AffineTransformType
LeastSquareAffineTransformEstimator(const Self &)=delete
void operator=(const Self &)=delete
itk::Matrix< PrecisionType, PointDimension, PointDimension > MatrixType
itk::CovariantVector< PrecisionType, PointDimension > CovariantVectorType
itk::Vector< PrecisionType, PointDimension > VectorType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.