40 if(isValid(newParameters))
42 m_internalParameters = newParameters;
50 m_internalParameters = newParameters;
52 if(computeParameters( m_internalParameters))
58 m_internalParameters.
reset();
66 assert(isValid(params));
68 const unsigned int tiepointsSize =
static_cast<unsigned int>(params.
m_tiePoints.size());
70 double maxError = 0.0;
71 double currentError = 0.0;
73 for(
unsigned int tpIndex = 0; tpIndex < tiepointsSize; ++tpIndex)
75 currentError = getDirectMappingError( params.
m_tiePoints[ tpIndex ], params );
77 if( currentError > maxError )
79 maxError = currentError;
88 assert( isValid( params ) );
90 const unsigned int tiepointsSize =
static_cast<unsigned int>(params.
m_tiePoints.size());
92 double maxError = 0.0;
94 double currentError = 0.0;
96 for(
unsigned int tpIndex = 0 ; tpIndex < tiepointsSize ; ++tpIndex )
98 currentError = getInverseMappingError( params.
m_tiePoints[ tpIndex ], params );
100 if( currentError > maxError )
102 maxError = currentError;
110 const std::vector< GTParameters::TiePoint >& tiePoints,
113 assert( isValid( params ) );
115 const unsigned int tiepointsSize =
static_cast<unsigned int>(tiePoints.size());
117 if( tiepointsSize == 0 )
123 double error2Sum = 0.0;
125 double currentError = 0.0;
127 for(
unsigned int tpIndex = 0 ; tpIndex < tiepointsSize ; ++tpIndex )
129 currentError = getDirectMappingError( tiePoints[ tpIndex ], params );
131 error2Sum += ( currentError * currentError );
134 return sqrt( error2Sum / static_cast<double>(tiepointsSize) );
139 const std::vector< GTParameters::TiePoint >& tiePoints,
142 assert( isValid( params ) );
144 const unsigned int tiepointsSize =
static_cast<unsigned int>(tiePoints.size());
146 if( tiepointsSize == 0 )
152 double error2Sum = 0.0;
153 double currentError = 0.0;
155 for(
unsigned int tpIndex = 0 ; tpIndex < tiepointsSize ; ++tpIndex )
157 currentError = getInverseMappingError( tiePoints[ tpIndex ],
160 error2Sum += ( currentError * currentError );
163 return sqrt( error2Sum / static_cast<double>(tiepointsSize) );
169 assert( isValid( params ) );
173 directMap( params, tiePoint.first, directMappedPoint );
175 double diffX = tiePoint.second.x - directMappedPoint.
x;
176 double diffY = tiePoint.second.y - directMappedPoint.
y;
178 return hypot( diffX, diffY );
183 assert( isValid( params ) );
187 inverseMap( params, tiePoint.second, inverseMappedPoint );
189 double diffX = tiePoint.first.x - inverseMappedPoint.
x;
190 double diffY = tiePoint.first.y - inverseMappedPoint.
y;
192 return hypot( diffX, diffY );
std::vector< TiePoint > m_tiePoints
Tie points.
An utility struct for representing 2D coordinates.
std::pair< Coord2D, Coord2D > TiePoint
Tie point type definition.
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state...
2D Geometric transformation parameters.