Commit dc2f68a1 authored by Julien Michel's avatar Julien Michel
Browse files

ENH: Specializing add tie points for forward and inverse models

parent 0778b4b5
......@@ -72,6 +72,8 @@ public:
/** Compute the world coordinates. */
OutputPointType TransformPoint(const InputPointType& point) const;
virtual void AddTiePoint(const InputPointType & inputPoint, const OutputPointType & outputPoint);
protected:
ForwardSensorModel();
virtual ~ForwardSensorModel();
......
......@@ -61,6 +61,27 @@ ForwardSensorModel<TScalarType, NInputDimensions, NOutputDimensions>
return outputPoint;
}
template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
void
ForwardSensorModel<TScalarType, NInputDimensions, NOutputDimensions>
:: AddTiePoint(const InputPointType & inputPoint, const OutputPointType & outputPoint)
{
double x = inputPoint[0];
double y = inputPoint[1];
double z = this->m_AverageElevation;
if (InputPointType::PointDimension == 3)
{
z = inputPoint[2];
}
double lon = outputPoint[0];
double lat = outputPoint[1];
this->m_Model->AddTiePoint(x,y,z,lon,lat);
}
template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
void
ForwardSensorModel<TScalarType, NInputDimensions, NOutputDimensions>
......
......@@ -74,6 +74,8 @@ public:
// Transform of geographic point in image sensor index -- Backward Compatibility
// OutputPointType TransformPoint(const InputPointType &point, double height) const;
virtual void AddTiePoint(const InputPointType & inputPoint, const OutputPointType & outputPoint);
protected:
InverseSensorModel();
virtual ~InverseSensorModel();
......
......@@ -64,6 +64,26 @@ InverseSensorModel<TScalarType, NInputDimensions, NOutputDimensions>
return outputPoint;
}
template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
void
InverseSensorModel<TScalarType, NInputDimensions, NOutputDimensions>
:: AddTiePoint(const InputPointType & inputPoint, const OutputPointType & outputPoint)
{
double x = outputPoint[0];
double y = outputPoint[1];
double z = this->m_AverageElevation;
if (OutputPointType::PointDimension == 3)
{
z = inputPoint[2];
}
double lon = inputPoint[0];
double lat = inputPoint[1];
this->m_Model->AddTiePoint(x,y,z,lon,lat);
}
template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
void
InverseSensorModel<TScalarType, NInputDimensions, NOutputDimensions>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment