OTB  10.0.0
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;
65 
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 
87 
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
Computes a bilinear projection after init with reference points.
Point2DType worldToLineSample(const Point3DType &worldPoint) const
itk::Point< double, 2 > Point2DType
LSQREstimatorType::Pointer m_LatFit
LSQREstimatorType::Pointer m_XFit
BilinearProjection(const Self &)=delete
std::vector< Point3DType > m_worldPoints
virtual ~BilinearProjection()=default
void setWorldPoints(const std::vector< Point3DType > &wPt)
LSQREstimatorType::Pointer m_LonFit
itk::SmartPointer< Self > Pointer
Point3DType lineSampleHeightToWorld(Point2DType lineSampPt, double heightAboveEllipsoid) const
const std::vector< Point2DType > & getLineSamplePoints() const
const std::vector< Point3DType > & getWorldPoints() const
std::vector< Point2DType > m_LineSamplePoints
LSQREstimatorType::Pointer m_YFit
void operator=(const Self &)=delete
Point3DType lineSampleToWorld(Point2DType lineSampPt) const
itk::Point< double, 3 > Point3DType
itk::Matrix< double, 3, 1 > MatrixType
void setLineSamplePoints(const std::vector< Point2DType > &lsPt)
BilinearProjection(const Point2DType &ul, const Point2DType &ur, const Point2DType &lr, const Point2DType &ll, const Point3DType &ulg, const Point3DType &urg, const Point3DType &lrg, const Point3DType &llg)
itk::SmartPointer< const Self > ConstPointer
This class provide the 2D Bilinear transform LSQR estimation.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.