OTB  9.1.1
Orfeo Toolbox
otbBilinearProjection.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 otbBilinearProjection_h
22 #define otbBilinearProjection_h
23 
24 #include <vector>
25 #include "itkObject.h"
26 #include "itkObjectFactory.h"
28 
29 namespace otb
30 {
38 class ITK_EXPORT BilinearProjection : public itk::Object
39 {
40 public:
41 
44  using SuperClass = itk::Object;
45  using Pointer = itk::SmartPointer<Self>;
46  using ConstPointer = itk::SmartPointer<const Self>;
47  using Point2DType = itk::Point<double, 2>;
48  using Point3DType = itk::Point<double, 3>;
50  using MatrixType = itk::Matrix<double, 3, 1>;
51 
53  itkNewMacro(Self);
54 
56  itkTypeMacro(BilinearProjection, Object);
57 
58  Point2DType worldToLineSample(const Point3DType& worldPoint) const;
64  Point3DType lineSampleToWorld(Point2DType lineSampPt) const;
65 
74  Point3DType lineSampleHeightToWorld(Point2DType lineSampPt,
75  double heightAboveEllipsoid) const;
76 
77  const std::vector<Point2DType>& getLineSamplePoints() const;
78 
79  void setLineSamplePoints(const std::vector<Point2DType>& lsPt);
80 
81  const std::vector<Point3DType>& getWorldPoints() const;
82 
83  void setWorldPoints(const std::vector<Point3DType>& wPt);
84 
86  bool imgPointsHaveNan();
87 
89  bool worldPointsHaveNan();
90 
92  void computeLS();
93 
94 protected:
97  const Point2DType& ur,
98  const Point2DType& lr,
99  const Point2DType& ll,
100  const Point3DType& ulg,
101  const Point3DType& urg,
102  const Point3DType& lrg,
103  const Point3DType& llg);
104  virtual ~BilinearProjection() = default;
105 
106 private:
107  BilinearProjection(const Self&) = delete;
108  void operator=(const Self&) = delete;
109 
110  std::vector<Point2DType> m_LineSamplePoints;
111  std::vector<Point3DType> m_worldPoints;
116 };
117 
118 } // end namespace otb
119 
120 #endif
otb::BilinearProjection::m_XFit
LSQREstimatorType::Pointer m_XFit
Definition: otbBilinearProjection.h:114
otb::BilinearProjection::MatrixType
itk::Matrix< double, 3, 1 > MatrixType
Definition: otbBilinearProjection.h:50
otb::BilinearProjection::m_LatFit
LSQREstimatorType::Pointer m_LatFit
Definition: otbBilinearProjection.h:113
otb::BilinearProjection::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbBilinearProjection.h:45
otb::BilinearProjection::m_YFit
LSQREstimatorType::Pointer m_YFit
Definition: otbBilinearProjection.h:115
otb::LeastSquareBilinearTransformEstimator::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbLeastSquareBilinearTransformEstimator.h:47
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::LeastSquareBilinearTransformEstimator
This class provide the 2D Bilinear transform LSQR estimation.
Definition: otbLeastSquareBilinearTransformEstimator.h:41
otb::BilinearProjection::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbBilinearProjection.h:46
otb::BilinearProjection::Point2DType
itk::Point< double, 2 > Point2DType
Definition: otbBilinearProjection.h:47
otb::BilinearProjection::m_worldPoints
std::vector< Point3DType > m_worldPoints
Definition: otbBilinearProjection.h:111
otb::BilinearProjection
Computes a bilinear projection after init with reference points.
Definition: otbBilinearProjection.h:38
otb::BilinearProjection::m_LineSamplePoints
std::vector< Point2DType > m_LineSamplePoints
Definition: otbBilinearProjection.h:110
otb::BilinearProjection::SuperClass
itk::Object SuperClass
Definition: otbBilinearProjection.h:44
otb::BilinearProjection::Point3DType
itk::Point< double, 3 > Point3DType
Definition: otbBilinearProjection.h:48
otbLeastSquareBilinearTransformEstimator.h
otb::BilinearProjection::m_LonFit
LSQREstimatorType::Pointer m_LonFit
Definition: otbBilinearProjection.h:112