OTB  9.0.0
Orfeo Toolbox
otbRPCTransformBase.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 otbRPCTransformBase_h
22 #define otbRPCTransformBase_h
23 
24 #include "otbSensorTransformBase.h"
25 #include "otbGeometryMetadata.h"
26 #include "otbGDALRPCTransformer.h"
27 
28 namespace otb
29 {
44 template <class TScalarType, unsigned int NInputDimensions = 3, unsigned int NOutputDimensions = 2>
45 class ITK_EXPORT RPCTransformBase : public SensorTransformBase<TScalarType, NInputDimensions, NOutputDimensions>
46 {
47 public:
52  using Pointer = itk::SmartPointer<Self>;
53  using ConstPointer = itk::SmartPointer<const Self> ;
54 
55  using InputPointType = itk::Point<TScalarType, NInputDimensions>;
56  using OutputPointType = itk::Point<TScalarType, NOutputDimensions>;
57  using TiePointsType = std::vector<std::pair<InputPointType,OutputPointType>>;
58  using PixelType =TScalarType;
60 
63 
64  itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions);
65  itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions);
66 
67  /*
68  * Provide the ImageMetadata in order to set the model.
69  * Return false if model not valid.
70  */
71  bool SetMetadata(const ImageMetadata& imd) override;
72 
74  bool IsValidSensorModel() const override;
75 
77  void OptimizeParameters(ImageMetadata& imd, const TiePointsType& tiepoints, double& rmsError) final;
78 
79 protected:
81  ~RPCTransformBase() = default;
82  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
83 
84  std::unique_ptr<Projection::RPCParam> m_RPCParam;
85  std::unique_ptr<GDALRPCTransformer> m_Transformer;
86 
87 private:
88  RPCTransformBase(const Self&) = delete;
89  void operator=(const Self&) = delete;
90 };
91 
92 }
93 
94 #ifndef OTB_MANUAL_INSTANTIATION
95 #include "otbRPCTransformBase.hxx"
96 #endif
97 
98 #endif
otbGDALRPCTransformer.h
otb::SensorTransformBase::TiePointsType
std::vector< std::pair< InputPointType, OutputPointType > > TiePointsType
Definition: otbSensorTransformBase.h:61
otb::SensorTransformBase::OutputPointType
itk::Point< TScalarType, NOutputDimensions > OutputPointType
Definition: otbSensorTransformBase.h:60
otb::SensorTransformBase::InputPointType
itk::Point< TScalarType, NInputDimensions > InputPointType
Definition: otbSensorTransformBase.h:59
otb::Transform< TScalarType, 2, 3 >::TransformDirection
TransformDirection
Definition: otbPCAImageFilter.h:34
otb::SensorTransformBase::PixelType
TScalarType PixelType
Definition: otbSensorTransformBase.h:62
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::SensorTransformBase::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbSensorTransformBase.h:57
otb::SensorTransformBase::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbSensorTransformBase.h:56
otbGeometryMetadata.h
otb::RPCTransformBase::m_Transformer
std::unique_ptr< GDALRPCTransformer > m_Transformer
Definition: otbRPCTransformBase.h:85
otb::RPCTransformBase::RPCTransformBase
RPCTransformBase(TransformDirection dir)
Definition: otbRPCTransformBase.h:80
otb::Transform
Class to overload method passed to virtual pure in ITK V4.
Definition: otbTransform.h:39
otb::RPCTransformBase::m_RPCParam
std::unique_ptr< Projection::RPCParam > m_RPCParam
Definition: otbRPCTransformBase.h:84
otb::RPCTransformBase
Base projection class based on the RPC method.
Definition: otbRPCTransformBase.h:45
otbSensorTransformBase.h
otb::SensorTransformBase
Base class for the sensor model projection classes.
Definition: otbSensorTransformBase.h:48
otb::ImageMetadata
Generic class containing image metadata used in OTB.
Definition: otbImageMetadata.h:270
otbRPCTransformBase.hxx