/usr/include/ossim/projection/ossimRpcModel.h is in libossim-dev 1.7.21-3ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | //*****************************************************************************
// FILE: ossimRpcModel.h
//
// License: See top level LICENSE.txt file.
//
// AUTHOR: Oscar Kramer
//
// DESCRIPTION: Contains declaration of class ossimRpcModel.
// This is a replacement model utilizing the Rational Polynomial Coefficients
// (RPC), a.k.a. Rapid Positioning Capability, and Universal Sensor Model
// (USM).
//
//*****************************************************************************
// $Id: ossimRpcModel.h 11521 2007-08-07 21:55:58Z dburken $
#ifndef ossimRpcModel_HEADER
#define ossimRpcModel_HEADER
#include <ossim/projection/ossimSensorModel.h>
#include <ossim/base/ossimIpt.h>
#include <ossim/base/ossimDblGrid.h>
#include <ossim/base/ossimFilename.h>
/*!****************************************************************************
*
* CLASS: ossimRpcModel
*
*****************************************************************************/
class OSSIMDLLEXPORT ossimRpcModel : public ossimSensorModel
{
public:
//***
// Enumeration of supported RPC polynomial formats:
//***
enum PolynomialType
{
A='A', // corresponds to "RPC00A"
B='B' // corresponds to "RPC00B"
};
/** @brief RPC model structure used for access function */
struct rpcModelStruct
{
double lineScale;
double sampScale;
double latScale;
double lonScale;
double hgtScale;
double lineOffset;
double sampOffset;
double latOffset;
double lonOffset;
double hgtOffset;
double lineNumCoef[20];
double lineDenCoef[20];
double sampNumCoef[20];
double sampDenCoef[20];
char type;
};
/** @brief default constructor */
ossimRpcModel();
/** @brief copy construtor */
ossimRpcModel(const ossimRpcModel& copy_this);
/** @brief virtual destructor */
virtual ~ossimRpcModel();
void setAttributes(ossim_float64 theSampleOffset,
ossim_float64 theLineOffset,
ossim_float64 theSampleScale,
ossim_float64 theLineScale,
ossim_float64 theLatOffset,
ossim_float64 theLonOffset,
ossim_float64 theHeightOffset,
ossim_float64 theLatScale,
ossim_float64 theLonScale,
ossim_float64 theHeightScale,
const std::vector<double>& xNumeratorCoeffs,
const std::vector<double>& xDenominatorCoeffs,
const std::vector<double>& yNumeratorCoeffs,
const std::vector<double>& yDenominatorCoeffs,
PolynomialType polyType = B,
bool computeGsdFlag=true);
void setMetersPerPixel(const ossimDpt& metersPerPixel);
/**
* This method computes the ground sample distance(gsd) and sets class
* attribute theGSD and theMeanGSD by doing a lineSampleHeightToWorld on
* three points and calculating the distance from them.
*
* @return Nothing but throws ossimException on error.
*/
void computeGsd();
/**
* @brief Sets data member theBiasError, theRandError.
*
* @param biasError Error - Bias 68% non time - varying error estimate
* assumes correlated images. Units = meters.
*
* @param randError Error - Random 68% time - varying error estimate
* assumes uncorrelated images. Units = meters.
*
* @param initNominalPostionErrorFlag If true the base data member
* theNominalPosError will be initialized with:
* sqrt(theBiasError*theBiasError +theRandError*theRandError)
*/
void setPositionError(const ossim_float64& biasError,
const ossim_float64& randomError,
bool initNominalPostionErrorFlag);
/**
* @brief worldToLineSample()
* Overrides base class implementation. Directly computes line-sample from
* the polynomials.
*/
virtual void worldToLineSample(const ossimGpt& world_point,
ossimDpt& image_point) const;
/**
* @brief print()
* Extends base-class implementation. Dumps contents of object to ostream.
*/
virtual std::ostream& print(std::ostream& out) const;
/**
* @brief saveState
* Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
* KWL files. Returns true if successful.
*/
virtual bool saveState(ossimKeywordlist& kwl,
const char* prefix=0) const;
/**
* @brief loadState
* Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
* KWL files. Returns true if successful.
*/
virtual bool loadState(const ossimKeywordlist& kwl,
const char* prefix=0);
//***
// @brief lineSampleToWorld()
// Overrides base class pure virtual. Intersects DEM.
//***
virtual void lineSampleToWorld(const ossimDpt& image_point,
ossimGpt& world_point) const;
//***
// @brief lineSampleHeightToWorld()
// Overrides base class pure virtual. Height understood to be relative to
// standard ellipsoid.
//***
virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
const double& heightEllipsoid,
ossimGpt& worldPoint) const;
/**
* @brief imagingRay()
* Overrides base class pure virtual.
*/
virtual void imagingRay(const ossimDpt& image_point,
ossimEcefRay& image_ray) const;
/**
* @brief STATIC METHOD: writeGeomTemplate(ostream)
* Writes a template of geom keywords processed by loadState and saveState
* to output stream.
*/
static void writeGeomTemplate(ostream& os);
virtual void updateModel();
virtual void initAdjustableParameters();
/**
* @brief dup()
* Returns pointer to a new instance, copy of this.
*/
virtual ossimObject* dup() const;
inline virtual bool useForward()const {return false;}
/** @brief uses file path to init model */
virtual bool setupOptimizer(const ossimString& init_file);
/**
* @brief Compute partials of samp/line WRT ground point
*
* @param parmIdx computational mode:
* OBS_INIT, EVALUATE, P_WRT_X, P_WRT_X, P_WRT_X.
*
* @param gpos Current ground point estimate.
*
* @param h Not used.
*
* @return OBS_INT: n/a, EVALUATE: residuals, P_WRT_X/Y/Z: partials.
*/
virtual ossimDpt getForwardDeriv(int parmIdx,
const ossimGpt& gpos,
double h);
/**
* @brief Returns Error - Bias.
* @return Error - Bias
* @note See NITF field "ERR_BIAS" from RPC00x tag where x = A or B.
*/
double getBiasError() const;
/**
* @brief Returns Error - Random.
* @return Error - Random
* @note See NITF field "ERR_RAND" from RPC00x tag where x = A or B.
*/
double getRandError() const;
/**
* @brief Returns RPC parameter set in structure.
* @param rpcModelStruct structure to initialize.
*/
void getRpcParameters(ossimRpcModel::rpcModelStruct& model) const;
protected:
enum AdjustParamIndex
{
INTRACK_OFFSET = 0,
CRTRACK_OFFSET,
INTRACK_SCALE,
CRTRACK_SCALE,
MAP_ROTATION,
// YAW_OFFSET,
NUM_ADJUSTABLE_PARAMS // not an index
};
//***
// Methods for computing RPC polynomial and its derivatives:
//***
double polynomial(const double& nlat,
const double& nlon,
const double& nhgt,
const double* coeffs) const;
double dPoly_dLat(const double& nlat,
const double& nlon,
const double& nhgt,
const double* coeffs) const;
double dPoly_dLon(const double& nlat,
const double& nlon,
const double& nhgt,
const double* coeffs) const;
double dPoly_dHgt(const double& nlat,
const double& nlon,
const double& nhgt,
const double* coeffs) const;
PolynomialType thePolyType;
//***
// Quantities for zero-biasing and normalizing the image point and
// ground point coordinates referenced in the polynomials:
//***
double theLineScale;
double theSampScale;
double theLatScale;
double theLonScale;
double theHgtScale;
double theLineOffset;
double theSampOffset;
double theLatOffset;
double theLonOffset;
double theHgtOffset;
//***
// Quantities derived from the adjustable parameters:
//***
double theIntrackOffset;
double theCrtrackOffset;
double theIntrackScale;
double theCrtrackScale;
double theCosMapRot;
double theSinMapRot;
/** error */
double theBiasError; // meters
double theRandError; // meters
//***
// Coefficients:
//***
double theLineNumCoef[20];
double theLineDenCoef[20];
double theSampNumCoef[20];
double theSampDenCoef[20];
TYPE_DATA
};
#endif
|