OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ossimSensorModelTuple Class Reference

#include <ossimSensorModelTuple.h>

Public Types

enum  DeriveMode {
  OBS_INIT =-99, EVALUATE =-98, P_WRT_X = -1, P_WRT_Y = -2,
  P_WRT_Z = -3
}
 
enum  IntersectStatus { OP_SUCCESS = 0, ERROR_PROP_FAIL = 1, OP_FAIL = 2 }
 

Public Member Functions

 ossimSensorModelTuple ()
 default constructor More...
 
 ~ossimSensorModelTuple ()
 virtual destructor More...
 
void addImage (ossimSensorModel *image)
 Method to add an image to the tuple. More...
 
std::ostream & print (std::ostream &out) const
 print method. More...
 
ossimSensorModelTuple::IntersectStatus intersect (const DptSet_t obs, ossimEcefPoint &pt, NEWMAT::Matrix &covMat) const
 Multi-image intersection method. More...
 
ossimSensorModelTuple::IntersectStatus intersect (const ossim_int32 &img, const ossimDpt &obs, ossimEcefPoint &pt, NEWMAT::Matrix &covMat)
 Single-image/DEM intersection method. More...
 
ossimSensorModelTuple::IntersectStatus intersect (const ossim_int32 &img, const ossimDpt &obs, const ossim_float64 &heightAboveEllipsoid, ossimEcefPoint &pt, NEWMAT::Matrix &covMat)
 Single-image/height intersection method. More...
 
bool setIntersectionSurfaceAccuracy (const ossim_float64 &surfCE90, const ossim_float64 &surfLE90)
 Set intersection surface accuracy method. More...
 
void getRpcPqeInputs (ossimRpcPqeInputs &obj) const
 

Private Member Functions

bool computeSingleInterCov (const ossim_int32 &img, const ossimDpt &obs, const ossimGpt &ptG, HeightRefType_t cRefType, NEWMAT::Matrix &covMat)
 Compute single image intersection covariance matrix. More...
 
bool getGroundObsEqComponents (const ossim_int32 img, const ossimDpt &obs, const ossimGpt &ptEst, ossimDpt &resid, NEWMAT::Matrix &B, NEWMAT::SymmetricMatrix &W) const
 Get observation equation components. More...
 
NEWMAT::Matrix invert (const NEWMAT::Matrix &m) const
 

Private Attributes

std::vector< ossimRefPtr< ossimSensorModel > > theImages
 
ossim_int32 theNumImages
 
ossim_float64 theSurfCE90
 
ossim_float64 theSurfLE90
 
bool theSurfAccSet
 
bool theSurfAccRepresentsNoDEM
 
ossimRpcPqeInputs theRpcPqeInputs
 Rpc model only, container to capture pqe inputs for report purposes only. More...
 

Detailed Description

Definition at line 42 of file ossimSensorModelTuple.h.

Member Enumeration Documentation

◆ DeriveMode

Enumerator
OBS_INIT 
EVALUATE 
P_WRT_X 
P_WRT_Y 
P_WRT_Z 

Definition at line 46 of file ossimSensorModelTuple.h.

◆ IntersectStatus

Enumerator
OP_SUCCESS 
ERROR_PROP_FAIL 
OP_FAIL 

Definition at line 55 of file ossimSensorModelTuple.h.

Constructor & Destructor Documentation

◆ ossimSensorModelTuple()

ossimSensorModelTuple::ossimSensorModelTuple ( )

default constructor

Definition at line 52 of file ossimSensorModelTuple.cpp.

53 :
54  theNumImages(0),
55  theSurfCE90(0.0),
56  theSurfLE90(0.0),
57  theSurfAccSet(false),
60 {
61  if (traceDebug())
62  {
64  << "\nossimSensorModelTuple::ossimSensorModelTuple DEBUG:"
65  << std::endl;
66 #ifdef OSSIM_ID_ENABLED
68  << "OSSIM_ID: " << OSSIM_ID << std::endl;
69 #endif
70  }
71 
72 }
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimRpcPqeInputs theRpcPqeInputs
Rpc model only, container to capture pqe inputs for report purposes only.

◆ ~ossimSensorModelTuple()

ossimSensorModelTuple::~ossimSensorModelTuple ( )

virtual destructor

Definition at line 79 of file ossimSensorModelTuple.cpp.

80 {
81  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG)
82  << "DEBUG: ~ossimSensorModelTuple(): entering..." << std::endl;
83  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG)
84  << "DEBUG: ~ossimSensorModelTuple(): returning..." << std::endl;
85 }
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

Member Function Documentation

◆ addImage()

void ossimSensorModelTuple::addImage ( ossimSensorModel image)

Method to add an image to the tuple.

Definition at line 94 of file ossimSensorModelTuple.cpp.

References theImages, and theNumImages.

Referenced by main().

95 {
96  theImages.push_back(image);
97  theNumImages++;
98 }
std::vector< ossimRefPtr< ossimSensorModel > > theImages

◆ computeSingleInterCov()

bool ossimSensorModelTuple::computeSingleInterCov ( const ossim_int32 img,
const ossimDpt obs,
const ossimGpt ptG,
HeightRefType_t  cRefType,
NEWMAT::Matrix &  covMat 
)
private

Compute single image intersection covariance matrix.

Parameters
imgImage set index of current image.
obsImage point observations.
ptGCurrent ground estimate.
cRefTypeCurrent height reference type.
covMat3X3 ECF position covariance matrix.
Returns
true on success, false on error.

Definition at line 403 of file ossimSensorModelTuple.cpp.

Referenced by intersect().

409 {
410  NEWMAT::SymmetricMatrix BtWB(3);
411  NEWMAT::Matrix B(2,3);
412  NEWMAT::SymmetricMatrix W(2);
413  NEWMAT::Matrix surfCovENU(3,3);
414  ossimDpt resid;
415 
416  bool tCovOK;
417  bool covOK;
418 
419  // Set the height reference
420  ossimHgtRef hgtRef(cRefType);
421 
422 
423  if (PTR_CAST(ossimRpcModel, theImages[img]))
424  {
426 
427  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
428  // Special case for handling RPC LOS error components
429  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
430  ossimGpt ptObs(obs.samp,obs.line);
431  theImages[img]->getForwardDeriv(OBS_INIT, ptObs);
432  resid = theImages[img]->getForwardDeriv(EVALUATE, ptG);
433  ossimDpt pWRTx = theImages[img]->getForwardDeriv(P_WRT_X, ptG);
434  ossimDpt pWRTy = theImages[img]->getForwardDeriv(P_WRT_Y, ptG);
435  ossimDpt pWRTz = theImages[img]->getForwardDeriv(P_WRT_Z, ptG);
436 
437  // Form required partials in local frame
438  ossimLsrSpace enu(ptG);
439  NEWMAT::Matrix jECF(3,2);
440  jECF(1,1) = pWRTx.u;
441  jECF(1,2) = pWRTx.v;
442  jECF(2,1) = pWRTy.u;
443  jECF(2,2) = pWRTy.v;
444  jECF(3,1) = pWRTz.u;
445  jECF(3,2) = pWRTz.v;
446  NEWMAT::Matrix jLSR(3,2);
447  jLSR = enu.ecefToLsrRotMatrix()*jECF;
448  ossim_float64 dU_dx = jLSR(1,1);
449  ossim_float64 dU_dy = jLSR(2,1);
450  ossim_float64 dU_dz = jLSR(3,1);
451  ossim_float64 dV_dx = jLSR(1,2);
452  ossim_float64 dV_dy = jLSR(2,2);
453  ossim_float64 dV_dz = jLSR(3,2);
454 
455  // Compute azimuth & elevation angles
456  ossim_float64 den = dU_dy*dV_dx - dV_dy*dU_dx;
457  ossim_float64 dY = dU_dx*dV_dz - dV_dx*dU_dz;
458  ossim_float64 dX = dV_dy*dU_dz - dU_dy*dV_dz;
459  ossim_float64 dy_dH = dY / den;
460  ossim_float64 dx_dH = dX / den;
461  ossim_float64 tAz = atan2(dx_dH, dy_dH);
462  ossim_float64 tEl = atan2(1.0, sqrt(dy_dH*dy_dH+dx_dH*dx_dH));
463 
464 
465  // Get the terrain surface info required by ossimPositionQualityEvaluator
466  ossimColumnVector3d surfN = hgtRef.getLocalTerrainNormal(ptG);
467  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
468  // Currently, the CE/LE must be explicitly set by the
469  // setIntersectionSurfaceAccuracy. When DEM accuracy maintenance
470  // is fully supported, the following call should be used.
471  // bool tCovOK = hgtRef.getHeightCovMatrix(ptG, covECF);
472  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
473  ossim_float64 surfCE;
474  ossim_float64 surfLE;
475 
477  {
478  //***************************************************************
479  // RPC_No_DEM_State Demo case
480  // In this case, surfCE90/surfLE90 are interpreted differently:
481  // [1] surfCE90 contains the scale divisor for RPC hgtScale
482  // [2] surfLE90 contains the probability level divisor for
483  // RPC hgtScale to yield a 1-sigma value
484  //***************************************************************
485 
486  // Reset the surface normal to vertical
487  surfN = surfN.zAligned();
488 
489  // Set approximate surface CE/LE based on RPC parameters
490  // [1] Assume range (scale) only to be 90% vertical error for now
491  // [2] Assume bias could be used for height
493  model->getRpcParameters(rpcPar);
494  ossim_float64 hgtRng = rpcPar.hgtScale;
495  surfCE = 0.0;
496  ossim_float64 scaledHgtRng = abs(hgtRng/theSurfCE90);
497  ossim_float64 scaled1SigmaHgtRng = abs(scaledHgtRng/theSurfLE90);
498  surfLE = scaled1SigmaHgtRng*1.6449;
499 
500  if(traceDebug())
501  {
503  << "\n computeSingleInterCov() RPC NoDEM state selected..."
504  << "\n RPC Height Scale = " << rpcPar.hgtScale <<" m"
505  << "\n Scale Divisor = " <<abs(theSurfCE90)
506  << "\n 1-Sigma Divisor = "<<abs(theSurfLE90)
507  << std::endl;
508  }
509  }
510  else
511  {
512  surfCE = theSurfCE90;
513  surfLE = theSurfLE90;
514  }
515 
516  tCovOK = hgtRef.getSurfaceCovMatrix(surfCE, surfLE, surfCovENU);
517 
518  // Evaluate & retrieve the ENU covariance matrix
519  if (tCovOK)
520  {
521  // Store for later retrieval...
528 
529  if(traceDebug())
530  {
532  << "\n RPC error prop parameters..."
533  << "\n Elevation Angle = " << tEl*DEG_PER_RAD<< " deg"
534  << "\n Azimuth Angle = " << tAz*DEG_PER_RAD<<" deg"
535  << "\n RPC Bias Error = " <<model->getBiasError() <<" m"
536  << "\n RPC Random Error = " <<model->getRandError()<<" m"
537  << "\n surfN = " <<surfN
538  << "\n surfCovENU = \n" <<surfCovENU
539  << std::endl;
540  }
541 
542  ossimEcefPoint pt(ptG);
543 
545  (pt,model->getBiasError(),model->getRandError(),
546  tEl,tAz,surfN,surfCovENU);
547  NEWMAT::Matrix covENU(3,3);
548  covOK = qev.getCovMatrix(covENU);
549 
550  // Transform to ECF for output
551  if (covOK)
552  {
553  covMat = enu.lsrToEcefRotMatrix()*covENU*enu.ecefToLsrRotMatrix();
554  }
555  }
556  else
557  {
558  covOK = false;
559  }
560  }
561 
562  else
563  {
564  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
565  // Standard covariance matrix formation
566  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
567  // Image contribution
568  covOK = getGroundObsEqComponents(img, obs, ptG, resid, B, W);
569  BtWB << B.t() * W * B;
570 
571  // Height contribution
572  NEWMAT::Matrix St(3,3);
573  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
574  // Currently, the CE/LE must be explicitly set by the
575  // setIntersectionSurfaceAccuracy. When DEM accuracy maintenance
576  // is fully supported, the following call should be used.
577  // hgtRef.getHeightCovMatrix(ptG, St);
578  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
579 
580  // Check for special case of "no DEM" error propagation, only used for RPC
582  {
583  if(traceDebug())
584  {
586  << "\n computeSingleInterCov() RPC NoDEM state selected..."
587  << " Not valid for this sensor model" << std::endl;
588  }
589  }
590 
591  if (hgtRef.getSurfaceCovMatrix(theSurfCE90, theSurfLE90, surfCovENU))
592  {
593  tCovOK = hgtRef.getSurfaceNormalCovMatrix(ptG, surfCovENU, St);
594  }
595  else
596  {
597  tCovOK = false;
598  }
599 
600  if (tCovOK)
601  {
602  NEWMAT::Matrix Sti = invert(St);
603  // Full ECF covariance matrix
604  covMat = invert(BtWB + Sti);
605  }
606  else
607  {
608  // Don't include height
609  covMat = invert(BtWB);
610  }
611  }
612 
613  return covOK;
614 }
NEWMAT::Matrix theSurfaceCovMatrix
#define DEG_PER_RAD
ossim_float64 theRpcAzimuthAngle
double u
Definition: ossimDpt.h:164
double samp
Definition: ossimDpt.h:164
ossim_float64 theRpcRandError
ossim_float64 theRpcBiasError
#define abs(a)
Definition: auxiliary.h:74
void getRpcParameters(ossimRpcModel::rpcModelStruct &model) const
Returns RPC parameter set in structure.
ossim_float64 theRpcElevationAngle
double ossim_float64
double line
Definition: ossimDpt.h:165
std::vector< ossimRefPtr< ossimSensorModel > > theImages
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
RPC model structure used for access function.
Definition: ossimRpcModel.h:44
NEWMAT::Matrix invert(const NEWMAT::Matrix &m) const
double getRandError() const
Returns Error - Random.
double getBiasError() const
Returns Error - Bias.
bool getGroundObsEqComponents(const ossim_int32 img, const ossimDpt &obs, const ossimGpt &ptEst, ossimDpt &resid, NEWMAT::Matrix &B, NEWMAT::SymmetricMatrix &W) const
Get observation equation components.
ossimColumnVector3d theSurfaceNormalVector
const ossimColumnVector3d & zAligned()
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
double v
Definition: ossimDpt.h:165
ossimRpcPqeInputs theRpcPqeInputs
Rpc model only, container to capture pqe inputs for report purposes only.

◆ getGroundObsEqComponents()

bool ossimSensorModelTuple::getGroundObsEqComponents ( const ossim_int32  img,
const ossimDpt obs,
const ossimGpt ptEst,
ossimDpt resid,
NEWMAT::Matrix &  B,
NEWMAT::SymmetricMatrix &  W 
) const
private

Get observation equation components.

Parameters
imgImage set index of current image.
iterCurrent iteration.
obsObservations.
ptEstCurrent ground estimate.
residObservation residuals.
BMatrix of partials of observations WRT X,Y,Z.
WWeight matrix of observations.
imgImage set index of current image.

Definition at line 351 of file ossimSensorModelTuple.cpp.

358 {
359  // Temporary image geometry
360  ossimImageGeometry* iGeom = new ossimImageGeometry(NULL, (ossimProjection*) theImages[img].get());
361 
362  // Evaluate residuals
363  ossimDpt computedImg;
364  iGeom->worldToLocal(ptEst, computedImg);
365  resid = obs - computedImg;
366 
367  // Evaluate partials B(2X3)
368  NEWMAT::Matrix Bt(3,2);
369  iGeom->computeGroundToImagePartials(Bt, ptEst);
370  B = Bt.t();
371 
372  // Get covariance matrix & form weight matrix
373  NEWMAT::SymmetricMatrix Cov(2);
375  covStatus = theImages[img]->getObsCovMat(obs,Cov);
376 
377  if (covStatus == ossimSensorModel::COV_INVALID)
378  {
379  W = 0.0;
380  W(1,1) = 1.0;
381  W(2,2) = 1.0;
382  }
383  else
384  {
385  NEWMAT::Matrix Wfull = invert(Cov);
386  W << Wfull;
387  }
388 
389  bool covOK = false;
390  if (covStatus == ossimSensorModel::COV_FULL)
391  covOK = true;
392 
393  return covOK;
394 }
bool computeGroundToImagePartials(NEWMAT::Matrix &result, const ossimGpt &gpt, const ossimDpt3d &deltaLlh)
std::vector< ossimRefPtr< ossimSensorModel > > theImages
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
NEWMAT::Matrix invert(const NEWMAT::Matrix &m) const
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.

◆ getRpcPqeInputs()

void ossimSensorModelTuple::getRpcPqeInputs ( ossimRpcPqeInputs obj) const
Parameters
objObject to initialize with rpc pqe inputs.

Definition at line 145 of file ossimSensorModelTuple.cpp.

References theRpcPqeInputs.

146 {
147  obj = theRpcPqeInputs;
148 }
ossimRpcPqeInputs theRpcPqeInputs
Rpc model only, container to capture pqe inputs for report purposes only.

◆ intersect() [1/3]

ossimSensorModelTuple::IntersectStatus ossimSensorModelTuple::intersect ( const DptSet_t  obs,
ossimEcefPoint pt,
NEWMAT::Matrix &  covMat 
) const

Multi-image intersection method.

Parameters
obsVector of image point observations.
ptIntersected ECF position of point.
covMat3X3 ECF position covariance matrix [m].
Returns
true on success, false on error.

Definition at line 173 of file ossimSensorModelTuple.cpp.

References OP_FAIL.

Referenced by main().

176 {
177  IntersectStatus opOK = OP_FAIL;
178  bool covOK = true;
179  bool epOK;
180  ossim_int32 nImages = (ossim_int32)obs.size();
181 
182  if (nImages > 1)
183  {
184 
185  // Matrices
186  NEWMAT::SymmetricMatrix N(3);
187  NEWMAT::SymmetricMatrix BtWB(3);
188  NEWMAT::Matrix Ni(3,3);
189  NEWMAT::ColumnVector C(3);
190  NEWMAT::ColumnVector BtWF(3);
191  NEWMAT::ColumnVector F(2);
192  NEWMAT::ColumnVector dR(3);
193  NEWMAT::Matrix B(2,3);
194  NEWMAT::SymmetricMatrix W(2);
195 
196  // Get a priori ground estimate using first point
197  ossimGpt estG;
198  theImages[0]->lineSampleToWorld(obs[0], estG);
199 
200  for (int iter=0; iter<5; iter++)
201  {
202  // cout<<"\n iter: "<<iter;
203 
204  N = 0.0;
205  C = 0.0;
206 
207  // Loop over observations
208  for (int i=0; i<nImages; i++)
209  {
210  ossimDpt resid;
211  if (!getGroundObsEqComponents(i, obs[i], estG, resid, B, W))
212  {
213  covOK = false;
214  }
215 
216  F[0] = resid.x;
217  F[1] = resid.y;
218  // cout<<"\n F{"<<i+1<<"}: "<<F[0]<<", "<<F[1];
219 
220  // Form coefficient matrix & discrepancy vector
221  BtWF << B.t() * W * F;
222  BtWB << B.t() * W * B;
223  C += BtWF;
224  N += BtWB;
225  }
226 
227  // Solve system
228  Ni = invert(N);
229  dR = Ni * C;
230 
231  // cout<<"\n dR: ("<<dR[0]<<", "<<dR[1]<<", "<<dR[2]<<")"<<endl;
232 
233  // Update estimate
234  double latUpd = estG.latd() - dR[0];
235  double lonUpd = estG.lond() - dR[1];
236  double hgtUpd = estG.height() - dR[2];
237 
238  estG.latd(latUpd);
239  estG.lond(lonUpd);
240  estG.height(hgtUpd);
241 
242  if (traceDebug())
243  {
245  << "DEBUG: intersect:\n"
246  << " iteration:\n" << iter
247  // << " C:\n" << C
248  // << " Ni:\n" << Ni
249  << " dR:\n" << dR <<std::endl;
250  }
251 
252  } // iterative loop
253 
254  // Return intersected point
255  ossimEcefPoint finalEst(estG);
256  pt = finalEst;
257 
258  // Return propagated covariance matrix
259  if (covOK)
260  {
261  covMat = Ni;
262  epOK = true;
263  }
264  else
265  epOK = false;
266 
267  // Set operation status
268  if (epOK)
269  opOK = OP_SUCCESS;
270  else
271  opOK = ERROR_PROP_FAIL;
272  }
273 
274  return opOK;
275 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
double y
Definition: ossimDpt.h:165
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
std::vector< ossimRefPtr< ossimSensorModel > > theImages
double height() const
Definition: ossimGpt.h:107
NEWMAT::Matrix invert(const NEWMAT::Matrix &m) const
double x
Definition: ossimDpt.h:164
bool getGroundObsEqComponents(const ossim_int32 img, const ossimDpt &obs, const ossimGpt &ptEst, ossimDpt &resid, NEWMAT::Matrix &B, NEWMAT::SymmetricMatrix &W) const
Get observation equation components.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ intersect() [2/3]

ossimSensorModelTuple::IntersectStatus ossimSensorModelTuple::intersect ( const ossim_int32 img,
const ossimDpt obs,
ossimEcefPoint pt,
NEWMAT::Matrix &  covMat 
)

Single-image/DEM intersection method.

Parameters
imgImage set index of current image.
obsImage point observations.
ptIntersected ECF position of point.
covMat3X3 ECF position covariance matrix [m].
Returns
true on success, false on error.

Definition at line 319 of file ossimSensorModelTuple.cpp.

References AT_DEM, computeSingleInterCov(), ERROR_PROP_FAIL, OP_FAIL, OP_SUCCESS, and theImages.

323 {
324  IntersectStatus opOK = OP_FAIL;
325  ossimGpt ptG;
326 
327  // Intersection
328  theImages[img]->lineSampleToWorld(obs, ptG);
329  ossimEcefPoint ptECF(ptG);
330  pt = ptECF;
331 
332  // Error propagation
333  bool epOK = computeSingleInterCov(img, obs, ptG, AT_DEM, covMat);
334 
335  // Set operation status
336  if (epOK)
337  opOK = OP_SUCCESS;
338  else
339  opOK = ERROR_PROP_FAIL;
340 
341  return opOK;
342 }
bool computeSingleInterCov(const ossim_int32 &img, const ossimDpt &obs, const ossimGpt &ptG, HeightRefType_t cRefType, NEWMAT::Matrix &covMat)
Compute single image intersection covariance matrix.
std::vector< ossimRefPtr< ossimSensorModel > > theImages

◆ intersect() [3/3]

ossimSensorModelTuple::IntersectStatus ossimSensorModelTuple::intersect ( const ossim_int32 img,
const ossimDpt obs,
const ossim_float64 heightAboveEllipsoid,
ossimEcefPoint pt,
NEWMAT::Matrix &  covMat 
)

Single-image/height intersection method.

Parameters
imgImage set index of current image.
obsImage point observations.
heightAboveEllipsoidDesired intersection height [m].
ptIntersected ECF position of point.
covMat3X3 ECF position covariance matrix [m].
Returns
true on success, false on error.

: This method's "const" qualifier was removed as it stores rpc inputs to the pqe constructor for report purposes.

Definition at line 285 of file ossimSensorModelTuple.cpp.

References AT_HGT, computeSingleInterCov(), ERROR_PROP_FAIL, OP_FAIL, OP_SUCCESS, and theImages.

290 {
291  IntersectStatus opOK = OP_FAIL;
292  ossimGpt ptG;
293 
294  // Intersection
295  theImages[img]->lineSampleHeightToWorld(obs, atHeightAboveEllipsoid, ptG);
296  ossimEcefPoint ptECF(ptG);
297  pt = ptECF;
298 
299  // Error propagation
300  bool epOK = computeSingleInterCov(img, obs, ptG, AT_HGT, covMat);
301 
302  // Set operation status
303  if (epOK)
304  opOK = OP_SUCCESS;
305  else
306  opOK = ERROR_PROP_FAIL;
307 
308  return opOK;
309 }
bool computeSingleInterCov(const ossim_int32 &img, const ossimDpt &obs, const ossimGpt &ptG, HeightRefType_t cRefType, NEWMAT::Matrix &covMat)
Compute single image intersection covariance matrix.
std::vector< ossimRefPtr< ossimSensorModel > > theImages

◆ invert()

NEWMAT::Matrix ossimSensorModelTuple::invert ( const NEWMAT::Matrix &  m) const
private

Definition at line 623 of file ossimSensorModelTuple.cpp.

References SVD().

624 {
625  ossim_uint32 idx = 0;
626  NEWMAT::DiagonalMatrix d;
627  NEWMAT::Matrix u;
628  NEWMAT::Matrix v;
629 
630  // decompose m.t*m into the singular values and vectors.
631  NEWMAT::SVD(m, d, u, v, true, true);
632 
633  // invert the diagonal
634  for(idx=0; idx < (ossim_uint32)d.Ncols(); ++idx)
635  {
636  if(d[idx] > 1e-14) //TBC : use DBL_EPSILON ?
637  {
638  d[idx] = 1.0/d[idx];
639  }
640  else
641  {
642  d[idx] = 0.0;
643  if (traceDebug())
644  {
646  << "DEBUG: ossimSensorModelTuple::invert(): "
647  << "\nsingular matrix in SVD..."
648  << std::endl;
649  }
650  }
651  }
652 
653  //compute inverse of decomposed m;
654  return v*d*u.t();
655 }
unsigned int ossim_uint32
void SVD(const Matrix &, DiagonalMatrix &, Matrix &, Matrix &, bool=true, bool=true)
Definition: svd.cpp:26
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ print()

std::ostream & ossimSensorModelTuple::print ( std::ostream &  out) const

print method.

Definition at line 156 of file ossimSensorModelTuple.cpp.

References theImages, and theNumImages.

157 {
158  out << "\n ossimSensorModelTuple::print:" << std::endl;
159  for (int i=0; i<theNumImages; ++i)
160  theImages[i]->print(out);
161 
162  return out;
163 }
std::ostream & print(std::ostream &out) const
print method.
std::vector< ossimRefPtr< ossimSensorModel > > theImages

◆ setIntersectionSurfaceAccuracy()

bool ossimSensorModelTuple::setIntersectionSurfaceAccuracy ( const ossim_float64 surfCE90,
const ossim_float64 surfLE90 
)

Set intersection surface accuracy method.

Parameters
surfCE9090% CE [m].
surfLE9090% LE [m].
Returns
true on success, false on exception. Entry of negative value(s) indicates "no DEM" error prop for RPC

Definition at line 110 of file ossimSensorModelTuple.cpp.

References theSurfAccRepresentsNoDEM, theSurfAccSet, theSurfCE90, and theSurfLE90.

112 {
113  bool setOK = false;
114 
115  if (surfCE90>=0.0 && surfLE90>=0.0)
116  {
117  theSurfCE90 = surfCE90;
118  theSurfLE90 = surfLE90;
119  theSurfAccSet = true;
121  setOK = true;
122  }
123  else
124  {
125  //***************************************************************
126  // RPC_No_DEM_State Demo case
127  // In this case, surfCE90/surfLE90 are interpreted differently:
128  // [1] surfCE90 contains the scale divisor for RPC hgtScale
129  // [2] surfLE90 contains the probability level divisor for
130  // RPC hgtScale to yield a 1-sigma value
131  // These coputations are performed in computeSingleInterCov.
132  //***************************************************************
133  theSurfCE90 = surfCE90;
134  theSurfLE90 = surfLE90;
135  theSurfAccSet = false;
137  setOK = true;
138  }
139 
140  return setOK;
141 }

Member Data Documentation

◆ theImages

std::vector<ossimRefPtr<ossimSensorModel> > ossimSensorModelTuple::theImages
mutableprivate

Definition at line 146 of file ossimSensorModelTuple.h.

Referenced by addImage(), intersect(), and print().

◆ theNumImages

ossim_int32 ossimSensorModelTuple::theNumImages
private

Definition at line 148 of file ossimSensorModelTuple.h.

Referenced by addImage(), and print().

◆ theRpcPqeInputs

ossimRpcPqeInputs ossimSensorModelTuple::theRpcPqeInputs
private

Rpc model only, container to capture pqe inputs for report purposes only.

Definition at line 158 of file ossimSensorModelTuple.h.

Referenced by getRpcPqeInputs().

◆ theSurfAccRepresentsNoDEM

bool ossimSensorModelTuple::theSurfAccRepresentsNoDEM
private

Definition at line 153 of file ossimSensorModelTuple.h.

Referenced by setIntersectionSurfaceAccuracy().

◆ theSurfAccSet

bool ossimSensorModelTuple::theSurfAccSet
private

Definition at line 152 of file ossimSensorModelTuple.h.

Referenced by setIntersectionSurfaceAccuracy().

◆ theSurfCE90

ossim_float64 ossimSensorModelTuple::theSurfCE90
private

Definition at line 150 of file ossimSensorModelTuple.h.

Referenced by setIntersectionSurfaceAccuracy().

◆ theSurfLE90

ossim_float64 ossimSensorModelTuple::theSurfLE90
private

Definition at line 151 of file ossimSensorModelTuple.h.

Referenced by setIntersectionSurfaceAccuracy().


The documentation for this class was generated from the following files: