21 #ifndef otbGCPsToRPCSensorModelImageFilter_hxx 22 #define otbGCPsToRPCSensorModelImageFilter_hxx 29 #include "itkMetaDataObject.h" 35 template <
class TImage>
37 : m_UseImageGCPs(false),
44 m_ModelUpToDate(false)
55 template <
class TImage>
63 template <
class TImage>
67 this->Superclass::Modified();
74 template <
class TImage>
81 template <
class TImage>
88 template <
class TImage>
97 template <
class TImage>
101 GCPType newGCP(sensorPoint, groundPoint);
108 template <
class TImage>
114 groundPointWithElevation[0] = groundPoint[0];
115 groundPointWithElevation[1] = groundPoint[1];
123 if (height != height)
125 groundPointWithElevation[2] = height;
134 this->
AddGCP(sensorPoint, groundPointWithElevation);
137 template <
class TImage>
148 template <
class TImage>
155 template <
class TImage>
164 template <
class TImage>
168 typename TImage::Pointer imagePtr = this->GetOutput();
171 for (
unsigned int i = 0; i < imagePtr->GetGCPCount(); ++i)
175 index[0] =
static_cast<long int>(imagePtr->GetGCPCol(i));
176 index[1] =
static_cast<long int>(imagePtr->GetGCPRow(i));
180 imagePtr->TransformIndexToPhysicalPoint(index, sensorPoint);
185 groundPoint[0] = imagePtr->GetGCPX(i);
186 groundPoint[1] = imagePtr->GetGCPY(i);
187 groundPoint[2] = imagePtr->GetGCPZ(i);
192 unsigned int currentGCP = 0;
210 this->
AddGCP(sensorPoint, groundPoint);
216 template <
class TImage>
221 RSTransformType::Pointer rsTransform = RSTransformType::New();
224 rsTransform->InstantiateTransform();
240 sensorPointTemp[0] = sensorPoint[0];
241 sensorPointTemp[1] = sensorPoint[1];
243 auto outPoint = rsTransform->TransformPoint(sensorPoint);
247 groundPoint2D[0] = groundPoint[0];
248 groundPoint2D[1] = groundPoint[1];
250 double error = outPoint.EuclideanDistanceTo(outPoint);
262 template <
class TImage>
266 Superclass::GenerateOutputInformation();
269 auto imagePtr = this->GetOutput();
293 template <
class TImage>
296 Superclass::PrintSelf(os, indent);
297 os << indent <<
"UseImageGCPs: " << (
m_UseImageGCPs ?
"yes" :
"no") << std::endl;
298 os << indent <<
"UseDEM: " << (
m_UseDEM ?
"yes" :
"no") << std::endl;
void Modified() const override
itk::Index< Monteverdi_DIMENSION > IndexType
double GetHeightAboveEllipsoid(double lon, double lat) const
std::vector< double > ErrorsContainerType
ImageMetadata m_ImageMetadata
ErrorsContainerType & GetErrorsContainer()
~GCPsToRPCSensorModelImageFilter() override
void PrintSelf(std::ostream &os, itk::Indent indent) const override
itk::Point< double, 2 > Point2DType
GCPsContainerType m_GCPsContainer
void SetGCPsContainer(const GCPsContainerType &container)
void SetUseImageGCPs(bool use)
GCPsContainerType & GetGCPsContainer()
std::pair< Point2DType, Point3DType > GCPType
std::vector< GCPType > GCPsContainerType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
void Solve(const GCPsContainerType &gcpContainer, double &rmsError, Projection::RPCParam &outputParams)
void AddGCP(const Point2DType &sensorPoint, const Point3DType &groundPoint)
Coefficients for RPC model (quite similar to GDALRPCInfo)
GCPsToRPCSensorModelImageFilter()
itk::Point< double, 3 > Point3DType
static DEMHandler & GetInstance()
ErrorsContainerType m_ErrorsContainer
void GenerateOutputInformation() override
void RemoveGCP(unsigned int id)