28 #ifdef OSSIM_ID_ENABLED 29 static const char OSSIM_ID[] =
"$Id: ossimSensorModelTuple.cpp 22045 2012-12-28 21:22:35Z dhicks $";
33 : theRpcElevationAngle(
ossim::
nan()),
37 theSurfaceNormalVector(),
38 theSurfaceCovMatrix(3,3)
58 theSurfAccRepresentsNoDEM(false),
64 <<
"\nossimSensorModelTuple::ossimSensorModelTuple DEBUG:" 66 #ifdef OSSIM_ID_ENABLED 68 <<
"OSSIM_ID: " << OSSIM_ID << std::endl;
82 <<
"DEBUG: ~ossimSensorModelTuple(): entering..." << std::endl;
84 <<
"DEBUG: ~ossimSensorModelTuple(): returning..." << std::endl;
115 if (surfCE90>=0.0 && surfLE90>=0.0)
158 out <<
"\n ossimSensorModelTuple::print:" << std::endl;
175 NEWMAT::Matrix& covMat)
const 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);
198 theImages[0]->lineSampleToWorld(obs[0], estG);
200 for (
int iter=0; iter<5; iter++)
208 for (
int i=0; i<nImages; i++)
221 BtWF << B.t() * W * F;
222 BtWB << B.t() * W * B;
234 double latUpd = estG.
latd() - dR[0];
235 double lonUpd = estG.
lond() - dR[1];
236 double hgtUpd = estG.
height() - dR[2];
245 <<
"DEBUG: intersect:\n" 246 <<
" iteration:\n" << iter
249 <<
" dR:\n" << dR <<std::endl;
289 NEWMAT::Matrix& covMat)
295 theImages[img]->lineSampleHeightToWorld(obs, atHeightAboveEllipsoid, ptG);
322 NEWMAT::Matrix& covMat)
328 theImages[img]->lineSampleToWorld(obs, ptG);
357 NEWMAT::SymmetricMatrix& W)
const 365 resid = obs - computedImg;
368 NEWMAT::Matrix Bt(3,2);
373 NEWMAT::SymmetricMatrix Cov(2);
375 covStatus =
theImages[img]->getObsCovMat(obs,Cov);
385 NEWMAT::Matrix Wfull =
invert(Cov);
408 NEWMAT::Matrix& covMat)
410 NEWMAT::SymmetricMatrix BtWB(3);
411 NEWMAT::Matrix B(2,3);
412 NEWMAT::SymmetricMatrix W(2);
413 NEWMAT::Matrix surfCovENU(3,3);
439 NEWMAT::Matrix jECF(3,2);
446 NEWMAT::Matrix jLSR(3,2);
462 ossim_float64 tEl = atan2(1.0, sqrt(dy_dH*dy_dH+dx_dH*dx_dH));
498 surfLE = scaled1SigmaHgtRng*1.6449;
503 <<
"\n computeSingleInterCov() RPC NoDEM state selected..." 504 <<
"\n RPC Height Scale = " << rpcPar.
hgtScale <<
" m" 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
546 tEl,tAz,surfN,surfCovENU);
547 NEWMAT::Matrix covENU(3,3);
548 covOK = qev.getCovMatrix(covENU);
569 BtWB << B.t() * W * B;
572 NEWMAT::Matrix St(3,3);
586 <<
"\n computeSingleInterCov() RPC NoDEM state selected..." 587 <<
" Not valid for this sensor model" << std::endl;
602 NEWMAT::Matrix Sti =
invert(St);
604 covMat =
invert(BtWB + Sti);
626 NEWMAT::DiagonalMatrix d;
646 <<
"DEBUG: ossimSensorModelTuple::invert(): " 647 <<
"\nsingular matrix in SVD..."
ossimSensorModelTuple()
default constructor
std::ostream & print(std::ostream &out) const
print method.
void getRpcPqeInputs(ossimRpcPqeInputs &obj) const
double lond() const
Will convert the radian measure to degrees.
double nan()
Method to return ieee floating point double precision NAN.
This code was derived from https://gist.github.com/mshockwave.
ossim_float64 theSurfLE90
bool computeGroundToImagePartials(NEWMAT::Matrix &result, const ossimGpt &gpt, const ossimDpt3d &deltaLlh)
vector< ossimDpt > DptSet_t
void getRpcParameters(ossimRpcModel::rpcModelStruct &model) const
Returns RPC parameter set in structure.
double latd() const
Will convert the radian measure to degrees.
bool computeSingleInterCov(const ossim_int32 &img, const ossimDpt &obs, const ossimGpt &ptG, HeightRefType_t cRefType, NEWMAT::Matrix &covMat)
Compute single image intersection covariance matrix.
virtual bool getSurfaceCovMatrix(const ossimGpt &pg, NEWMAT::Matrix &cov) const
Method to get surface information string.
ossimSensorModelTuple::IntersectStatus intersect(const DptSet_t obs, ossimEcefPoint &pt, NEWMAT::Matrix &covMat) const
Multi-image intersection method.
const NEWMAT::Matrix & lsrToEcefRotMatrix() const
std::vector< ossimRefPtr< ossimSensorModel > > theImages
~ossimSensorModelTuple()
virtual destructor
unsigned int ossim_uint32
void SVD(const Matrix &, DiagonalMatrix &, Matrix &, Matrix &, bool=true, bool=true)
RPC model structure used for access function.
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
bool setIntersectionSurfaceAccuracy(const ossim_float64 &surfCE90, const ossim_float64 &surfLE90)
Set intersection surface accuracy method.
NEWMAT::Matrix ecefToLsrRotMatrix() const
virtual ossimColumnVector3d getLocalTerrainNormal(const ossimGpt &pg) const
Method to get local terrain normal unit vector (slope).
ossim_float64 theSurfCE90
NEWMAT::Matrix invert(const NEWMAT::Matrix &m) const
double getRandError() const
Returns Error - Random.
double getBiasError() const
Returns Error - Bias.
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
void addImage(ossimSensorModel *image)
Method to add an image to the tuple.
bool theSurfAccRepresentsNoDEM
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.
bool getSurfaceNormalCovMatrix(const ossimGpt &pg, const NEWMAT::Matrix &surfCov, NEWMAT::Matrix &normCov) const
Method to get surface normal covariance matrix.
const ossimColumnVector3d & zAligned()
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.
ossimRpcPqeInputs theRpcPqeInputs
Rpc model only, container to capture pqe inputs for report purposes only.