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

#include <ossimFcsiModel.h>

Inheritance diagram for ossimFcsiModel:
ossimSensorModel ossimProjection ossimOptimizableProjection ossimAdjustableParameterInterface ossimObject ossimErrorStatusInterface ossimReferenced

Public Types

enum  AdjustParamIndex {
  X_POS = 0, Y_POS, Z_POS, X_ROT,
  Y_ROT, Z_ROT, FOCAL_LEN, SCAN_SKEW,
  NUM_ADJUSTABLE_PARAMS
}
 
- Public Types inherited from ossimSensorModel
enum  CovMatStatus { COV_INVALID = 0, COV_PARTIAL = 1, COV_FULL = 2 }
 
enum  DeriveMode {
  OBS_INIT =-99, EVALUATE =-98, P_WRT_X = -1, P_WRT_Y = -2,
  P_WRT_Z = -3
}
 

Public Member Functions

 ossimFcsiModel ()
 
 ossimFcsiModel (const ossimFilename &init_file)
 
 ossimFcsiModel (const ossimKeywordlist &geom_kwl)
 
 ossimFcsiModel (const ossimFcsiModel &rhs)
 
virtual ossimObjectdup () const
 
virtual std::ostream & print (std::ostream &out) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual void lineSampleHeightToWorld (const ossimDpt &image_point, const double &heightEllipsoid, ossimGpt &worldPoint) const
 
virtual void imagingRay (const ossimDpt &image_point, ossimEcefRay &image_ray) const
 
virtual void worldToLineSample (const ossimGpt &world_point, ossimDpt &image_point) const
 
virtual void updateModel ()
 
virtual bool useForward () const
 
- Public Member Functions inherited from ossimSensorModel
 ossimSensorModel ()
 
 ossimSensorModel (const ossimSensorModel &copy_this)
 
 ossimSensorModel (const ossimKeywordlist &geom_kwl)
 
const ossimSensorModeloperator= (const ossimSensorModel &rhs)
 assignment operator More...
 
virtual ossimObjectgetBaseObject ()
 
virtual const ossimObjectgetBaseObject () const
 
virtual ossimGpt origin () const
 
virtual ossimDpt getMetersPerPixel () const
 
virtual const double & getNominalPosError () const
 Returns the estimated Absolute horizontal position error (CE90) of the sensor model. More...
 
virtual const double & getRelativePosError () const
 Returns the estimated RELATIVE horizontal position error (CE90) of the sensor model. More...
 
virtual void setNominalPosError (const double &ce90)
 Assigns the absolute image position error uncertainty (abs CE90) More...
 
virtual void setRelativePosError (const double &ce90)
 Assigns the relative image position error uncertainty (rel CE90) More...
 
virtual void lineSampleToWorld (const ossimDpt &image_point, ossimGpt &world_point) const
 
void setRefImgPt (const ossimDpt &pt)
 Sets the center line sampe of the image. More...
 
void setRefGndPt (const ossimGpt &pt)
 Sets the center latitude, longitude, height of the image. More...
 
void setImageRect (const ossimDrect &imageRect)
 
void setGroundRect (const ossimGpt &ul, const ossimGpt &ur, const ossimGpt &lr, const ossimGpt &ll)
 
ossimDpt imageSize () const
 
void setImageSize (const ossimDpt &size)
 
virtual void adjustableParametersChanged ()
 
virtual bool insideImage (const ossimDpt &p) const
 
virtual bool operator== (const ossimProjection &proj) const
 
const ossimStringgetImageID () const
 Access methods: More...
 
const ossimDrectgetImageClipRect () const
 
virtual ossim_uint32 degreesOfFreedom () const
 
virtual bool needsInitialState () const
 needsInitialState() More...
 
virtual double optimizeFit (const ossimTieGptSet &tieSet, double *targetVariance=0)
 
virtual ossimDpt getForwardDeriv (int parmIdx, const ossimGpt &gpos, double hdelta=1e-11)
 
virtual ossimGpt getInverseDeriv (int parmIdx, const ossimDpt &ipos, double hdelta=1e-11)
 
virtual ossimSensorModel::CovMatStatus getObsCovMat (const ossimDpt &ipos, NEWMAT::SymmetricMatrix &Cov, const ossim_float64 defPointingSigma=0.5) const
 Gives 2X2 covariance matrix of observations. More...
 
virtual bool isAffectedByElevation () const
 Implementation of pure virtual ossimProjection::isAffectedByElevation method. More...
 
void computeGsd ()
 This method computes the ground sample distance(gsd) and sets class attributes theGSD and theMeanGSD by doing a lineSampleHeightToWorld on four points and calculating the distance from them. More...
 
virtual bool getImageGeometry (const ossimString &, const ossimString &, ossimKeywordlist &) const
 Extracts geometry info from a non-ossim key,value pair to an ossim keyword list. More...
 
- Public Member Functions inherited from ossimProjection
 ossimProjection ()
 
virtual ~ossimProjection ()
 
virtual ossimDpt forward (const ossimGpt &wp) const
 
virtual ossimGpt inverse (const ossimDpt &pp) const
 
virtual void getRoundTripError (const ossimDpt &imagePoint, ossimDpt &errorResult) const
 
virtual void getRoundTripError (const ossimGpt &groundPoint, ossimDpt &errorResult) const
 
virtual void getGroundClipPoints (ossimGeoPolygon &gpts) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual bool operator!= (const ossimProjection &projection) const
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 
- Public Member Functions inherited from ossimOptimizableProjection
 ossimOptimizableProjection ()
 
 ossimOptimizableProjection (const ossimOptimizableProjection &source)
 
virtual ~ossimOptimizableProjection ()
 
virtual ossimOptimizableProjectionoperator= (const ossimOptimizableProjection &source)
 
virtual bool setupOptimizer (const ossimString &setup)
 setupFromString() Derived classes should implement as needed. Initialize parameters needed for optimizeFit and degreesOfFreedom More...
 
- Public Member Functions inherited from ossimAdjustableParameterInterface
 ossimAdjustableParameterInterface ()
 
 ossimAdjustableParameterInterface (const ossimAdjustableParameterInterface &rhs)
 
virtual ~ossimAdjustableParameterInterface ()
 
void newAdjustment (ossim_uint32 numberOfParameters=0)
 
void setAdjustmentDescription (const ossimString &description)
 
ossimString getAdjustmentDescription () const
 
ossimString getAdjustmentDescription (ossim_uint32 adjustmentIdx) const
 Returns adjustmentDescription of specific adjustmentInfo. More...
 
void setCurrentAdjustment (ossim_uint32 adjustmentIndex, bool notify=false)
 
bool setCurrentAdjustment (const ossimString &description, bool notify=false)
 Sets the current adjustment to the adjustment with a matching description. More...
 
void eraseAdjustment (bool notify)
 
void eraseAdjustment (ossim_uint32 idx, bool notify)
 
void resetAdjustableParameters (bool notify=false)
 
void copyAdjustment (ossim_uint32 idx, bool notify)
 
void copyAdjustment (bool notify=false)
 
void keepAdjustment (ossim_uint32 idx, bool createCopy)
 
virtual void keepAdjustment (bool createCopy=true)
 
const ossimAdjustableParameterInterfaceoperator= (const ossimAdjustableParameterInterface &rhs)
 
void removeAllAdjustments ()
 
ossim_uint32 getNumberOfAdjustableParameters () const
 
double getAdjustableParameter (ossim_uint32 idx) const
 
virtual void setAdjustableParameter (ossim_uint32 idx, double value, bool notify=false)
 
virtual void setAdjustableParameter (ossim_uint32 idx, double value, double sigma, bool notify=false)
 
double getParameterSigma (ossim_uint32 idx) const
 
void setParameterSigma (ossim_uint32 idx, double value, bool notify=false)
 
ossimUnitType getParameterUnit (ossim_uint32 idx) const
 
void setParameterUnit (ossim_uint32 idx, ossimUnitType unit)
 
void setParameterUnit (ossim_uint32 idx, const ossimString &unit)
 
void setParameterCenter (ossim_uint32 idx, double center, bool notify=false)
 
double getParameterCenter (ossim_uint32 idx) const
 
double computeParameterOffset (ossim_uint32 idx) const
 
void setParameterOffset (ossim_uint32 idx, ossim_float64 value, bool notify=false)
 
ossimString getParameterDescription (ossim_uint32 idx) const
 
void setParameterDescription (ossim_uint32 idx, const ossimString &descrption)
 
ossim_int32 findParameterIdxGivenDescription (ossim_uint32 adjustmentIdx, const ossimString &name) const
 
ossim_int32 findParameterIdxContainingDescription (ossim_uint32 adjustmentIdx, const ossimString &name) const
 
bool isParameterLocked (ossim_uint32 idx) const
 
void setParameterLockFlag (ossim_uint32 idxParam, bool flag)
 
bool getParameterLockFlag (ossim_uint32 idx) const
 
void lockAllParametersCurrentAdjustment ()
 
void unlockAllParametersCurrentAdjustment ()
 
void lockAllParameters (ossim_uint32 idxAdjustment)
 
void unlockAllParameters (ossim_uint32 idxAdjustment)
 
void resizeAdjustableParameterArray (ossim_uint32 numberOfParameters)
 
void setAdjustment (const ossimAdjustmentInfo &adj, bool notify=false)
 
void setAdjustment (ossim_uint32 idx, const ossimAdjustmentInfo &adj, bool notify=false)
 
void addAdjustment (const ossimAdjustmentInfo &adj, bool notify)
 
void getAdjustment (ossimAdjustmentInfo &adj) const
 
void getAdjustment (ossim_uint32 idx, ossimAdjustmentInfo &adj) const
 
ossim_uint32 getNumberOfAdjustments () const
 
ossim_uint32 getCurrentAdjustmentIdx () const
 
void setDirtyFlag (bool flag=true)
 
void setAllDirtyFlag (bool flag=true)
 
bool hasDirtyAdjustments () const
 
virtual void saveCurrentAdjustmentOnly (ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
 Saves the current active adjustment to the KWL file. More...
 
bool saveAdjustments (ossimKeywordlist &kwl, const ossimString &prefix=ossimString("")) const
 Save all adjustments to the KWL file. More...
 
bool loadAdjustments (const ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
 
std::ostream & print (std::ostream &out) const
 Dumps the currently active adjustment to ostream. More...
 

Static Public Member Functions

static void writeGeomTemplate (ostream &os)
 
- Static Public Member Functions inherited from ossimSensorModel
static void writeGeomTemplate (ostream &os)
 

Static Public Attributes

static const char * PRINCIPAL_POINT_X_KW = "principal_point_x"
 
static const char * PRINCIPAL_POINT_Y_KW = "principal_point_y"
 
static const char * SCAN_SCALE_MATRIX_00_KW = "scan_scale_matrix_00"
 
static const char * SCAN_SCALE_MATRIX_01_KW = "scan_scale_matrix_01"
 
static const char * SCAN_SCALE_MATRIX_10_KW = "scan_scale_matrix_10"
 
static const char * SCAN_SCALE_MATRIX_11_KW = "scan_scale_matrix_11"
 
static const char * SCAN_SKEW_ANGLE_KW = "scan_skew_angle"
 
static const char * SCAN_ROTATION_ANGLE_KW = "scan_rotation_angle"
 
static const char * FOCAL_LENGTH_KW = "focal_length"
 
static const char * PLATFORM_POSITION_X_KW = "platform_position_x"
 
static const char * PLATFORM_POSITION_Y_KW = "platform_position_y"
 
static const char * PLATFORM_POSITION_Z_KW = "platform_position_z"
 
static const char * CAMERA_ORIENTATION_MATRIX_ELEM_KW = "camera_orientation_matrix_elem_"
 

Protected Member Functions

virtual ~ossimFcsiModel ()
 ground to image faster (you don't need DEM) More...
 
void initAdjustableParameters ()
 
- Protected Member Functions inherited from ossimSensorModel
virtual ~ossimSensorModel ()
 
virtual ossimDpt extrapolate (const ossimGpt &gp) const
 
virtual ossimGpt extrapolate (const ossimDpt &ip, const double &height=ossim::nan()) const
 
void buildNormalEquation (const ossimTieGptSet &tieSet, NEWMAT::SymmetricMatrix &A, NEWMAT::ColumnVector &residue, NEWMAT::ColumnVector &projResidue, double pstep_scale)
 
NEWMAT::ColumnVector getResidue (const ossimTieGptSet &tieSet)
 
NEWMAT::ColumnVector solveLeastSquares (NEWMAT::SymmetricMatrix &A, NEWMAT::ColumnVector &r) const
 
NEWMAT::Matrix invert (const NEWMAT::Matrix &m) const
 stable invert stolen from ossimRpcSolver More...
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimAdjustableParameterInterface
bool paramChanged (ossim_uint32 param_idx) const
 Returns true if specified parameter has been modified since last setAllChangeFlag(false) call. More...
 
void setAllChangeFlags (bool areChanged)
 Sets all the change flags to the boolean indicated to indicate parameters are changed (TRUE) or not (FALSE). More...
 
void initChangeFlags ()
 Initializes the change flags to TRUE. More...
 

Protected Attributes

ossimDpt thePrincipalPoint
 
double theScanScaleMatrix [4]
 
double theScanSkew
 
double theScanRotation
 
double theFocalLen
 
ossimRadialDecentLensDistortiontheOpticalDistortion
 
ossimEcefPoint thePlatformPos
 
NEWMAT::Matrix theLsrToEcfRot
 
ossimEcefVector theEcfOffset
 
double theXrotCorr
 
double theYrotCorr
 
double theZrotCorr
 
double theFocalOffset
 
double theScanSkewCorr
 
ossimEcefPoint theAdjPlatformPos
 
double theAdjFocalLen
 
NEWMAT::Matrix theAdjLsrToEcfRot
 
NEWMAT::Matrix theAdjEcfToLsrRot
 
double theScanXformMatrix [4]
 
double theInvScanXformMatrix [4]
 
- Protected Attributes inherited from ossimSensorModel
ossimIpt theImageSize
 
ossimDpt theSubImageOffset
 
ossimString theImageID
 
ossimString theSensorID
 
ossimDpt theGSD
 
ossim_float64 theMeanGSD
 
ossimGpt theRefGndPt
 
ossimDpt theRefImgPt
 
ossimPolygon theBoundGndPolygon
 
ossimDrect theImageClipRect
 
ossim_float64 theRelPosError
 
ossim_float64 theNominalPosError
 
ossimDpt theParWRTx
 Partials for current point. More...
 
ossimDpt theParWRTy
 
ossimDpt theParWRTz
 
ossimDpt theObs
 Observations & residuals for current point. More...
 
ossimDpt theResid
 
ossimRefPtr< ossimProjectiontheSeedFunction
 Used as an initial guess for iterative solutions and a guess for points outside the support bounds. More...
 
bool theExtrapolateImageFlag
 
bool theExtrapolateGroundFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Detailed Description

Definition at line 82 of file ossimFcsiModel.h.

Member Enumeration Documentation

◆ AdjustParamIndex

Enumerator
X_POS 
Y_POS 
Z_POS 
X_ROT 
Y_ROT 
Z_ROT 
FOCAL_LEN 
SCAN_SKEW 
NUM_ADJUSTABLE_PARAMS 

Definition at line 94 of file ossimFcsiModel.h.

Constructor & Destructor Documentation

◆ ossimFcsiModel() [1/4]

ossimFcsiModel::ossimFcsiModel ( )

CONSTRUCTORS:

Definition at line 138 of file ossimFcsiModel.cpp.

139  :
140  ossimSensorModel (),
141  thePrincipalPoint (0, 0),
142  theScanSkew (0.0),
143  theScanRotation (0.0),
145  theLsrToEcfRot (3, 3),
146  theEcfOffset (0, 0, 0),
147  theXrotCorr (0.0),
148  theYrotCorr (0.0),
149  theZrotCorr (0.0),
150  theFocalOffset (0.0),
151  theScanSkewCorr (0.0),
152  theAdjLsrToEcfRot (3, 3),
153  theAdjEcfToLsrRot (3, 3)
154 {
155  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
156  theScanScaleMatrix[0] = 1.0;
157  theScanScaleMatrix[1] = 0.0;
158  theScanScaleMatrix[2] = 0.0;
159  theScanScaleMatrix[3] = 1.0;
160  theScanXformMatrix[0] = 1.0;
161  theScanXformMatrix[1] = 0.0;
162  theScanXformMatrix[2] = 0.0;
163  theScanXformMatrix[3] = 1.0;
165  setErrorStatus(); // indicate uninitialized
166 
167  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: returning..." << std::endl;
168 }
double theScanSkewCorr
ossimEcefVector theEcfOffset
NEWMAT::Matrix theAdjEcfToLsrRot
NEWMAT::Matrix theLsrToEcfRot
ossimRadialDecentLensDistortion * theOpticalDistortion
double theScanScaleMatrix[4]
void initAdjustableParameters()
NEWMAT::Matrix theAdjLsrToEcfRot
double theScanRotation
ossimDpt thePrincipalPoint
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
double theScanXformMatrix[4]

◆ ossimFcsiModel() [2/4]

ossimFcsiModel::ossimFcsiModel ( const ossimFilename init_file)

Definition at line 176 of file ossimFcsiModel.cpp.

177  :
178  ossimSensorModel (),
179  thePrincipalPoint (0, 0),
180  theScanSkew (0.0),
181  theScanRotation (0.0),
183  theLsrToEcfRot (3, 3),
184  theEcfOffset (0, 0, 0),
185  theXrotCorr (0.0),
186  theYrotCorr (0.0),
187  theZrotCorr (0.0),
188  theFocalOffset (0.0),
189  theScanSkewCorr (0.0),
190  theAdjLsrToEcfRot (3, 3),
191  theAdjEcfToLsrRot (3, 3)
192 {
193  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
194 
196  ossimKeywordlist kwl (init_file);
197  loadState(kwl);
198 
199  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: Exited..." << std::endl;
200 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
double theScanSkewCorr
Represents serializable keyword/value map.
ossimEcefVector theEcfOffset
NEWMAT::Matrix theAdjEcfToLsrRot
NEWMAT::Matrix theLsrToEcfRot
ossimRadialDecentLensDistortion * theOpticalDistortion
void initAdjustableParameters()
NEWMAT::Matrix theAdjLsrToEcfRot
double theScanRotation
ossimDpt thePrincipalPoint
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ossimFcsiModel() [3/4]

ossimFcsiModel::ossimFcsiModel ( const ossimKeywordlist geom_kwl)

Definition at line 208 of file ossimFcsiModel.cpp.

209  :
210  ossimSensorModel (),
211  thePrincipalPoint (0, 0),
212  theScanSkew (0.0),
213  theScanRotation (0.0),
215  theLsrToEcfRot (3, 3),
216  theEcfOffset (0, 0, 0),
217  theXrotCorr (0.0),
218  theYrotCorr (0.0),
219  theZrotCorr (0.0),
220  theFocalOffset (0.0),
221  theScanSkewCorr (0.0),
222  theAdjLsrToEcfRot (3, 3),
223  theAdjEcfToLsrRot (3, 3)
224 {
225  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
226 
228  loadState(geom_kwl);
229 
230  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: Exited..." << std::endl;
231 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
double theScanSkewCorr
ossimEcefVector theEcfOffset
NEWMAT::Matrix theAdjEcfToLsrRot
NEWMAT::Matrix theLsrToEcfRot
ossimRadialDecentLensDistortion * theOpticalDistortion
void initAdjustableParameters()
NEWMAT::Matrix theAdjLsrToEcfRot
double theScanRotation
ossimDpt thePrincipalPoint
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ossimFcsiModel() [4/4]

ossimFcsiModel::ossimFcsiModel ( const ossimFcsiModel rhs)

Definition at line 236 of file ossimFcsiModel.cpp.

237  :
238  ossimSensorModel (foxy),
239  thePrincipalPoint (foxy.thePrincipalPoint),
240  theScanSkew (foxy.theScanSkew),
241  theScanRotation (foxy.theScanRotation),
242  theFocalLen (foxy.theFocalLen),
243  thePlatformPos (foxy.thePlatformPos),
244  theLsrToEcfRot (foxy.theLsrToEcfRot),
245  theEcfOffset (foxy.theEcfOffset),
246  theXrotCorr (foxy.theXrotCorr),
247  theYrotCorr (foxy.theYrotCorr),
248  theZrotCorr (foxy.theZrotCorr),
249  theFocalOffset (foxy.theFocalOffset),
250  theScanSkewCorr (foxy.theScanSkewCorr)
251 {
252  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
253 
254  if(foxy.theOpticalDistortion)
255  {
256  //
257  // Finish the copy:
258  //
260  new ossimRadialDecentLensDistortion (*(foxy.theOpticalDistortion));
261  }
262 
263  for (int i=0; i<4; i++)
264  theScanScaleMatrix[i] = foxy.theScanScaleMatrix[i];
265 
266  //***
267  // Compute quantities derived from adjustables:
268  //***
269  updateModel();
270 
271  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: returning..." << std::endl;
272 }
double theScanSkewCorr
virtual void updateModel()
ossimEcefVector theEcfOffset
NEWMAT::Matrix theLsrToEcfRot
ossimRadialDecentLensDistortion * theOpticalDistortion
double theScanScaleMatrix[4]
ossimEcefPoint thePlatformPos
double theScanRotation
ossimDpt thePrincipalPoint
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ~ossimFcsiModel()

virtual ossimFcsiModel::~ossimFcsiModel ( )
inlineprotectedvirtual

ground to image faster (you don't need DEM)

Definition at line 184 of file ossimFcsiModel.h.

184 { delete theOpticalDistortion; }
ossimRadialDecentLensDistortion * theOpticalDistortion

Member Function Documentation

◆ dup()

virtual ossimObject* ossimFcsiModel::dup ( ) const
inlinevirtual

Returns pointer to a new instance, copy of this.

Implements ossimProjection.

Definition at line 110 of file ossimFcsiModel.h.

110 { return new ossimFcsiModel(*this); }

◆ imagingRay()

void ossimFcsiModel::imagingRay ( const ossimDpt image_point,
ossimEcefRay image_ray 
) const
virtual

Given an image point, returns a ray originating at some arbitrarily high point (ideally at the sensor position) and pointing towards the target.

Reimplemented from ossimSensorModel.

Definition at line 334 of file ossimFcsiModel.cpp.

336 {
337  bool debug = false; // setable via interactive debugger: "set debug = true"
338  if (traceExec() || debug) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::imagingRay: entering..." << std::endl;
339 
340  //***
341  // In case this is a sub-image of a full image scan, need to add the
342  // sub-image offset maintained in the base-class:
343  //***
344  ossimDpt p0 (image_point + theSubImageOffset);
345 
346  if (traceDebug() || debug)
347  {
348  ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
349  ossimNotify(ossimNotifyLevel_DEBUG) << "theSubImageOffset = " << theSubImageOffset << std::endl;
350  ossimNotify(ossimNotifyLevel_DEBUG) << "p0 = " << p0 << std::endl;
351  }
352 
353  //***
354  // Apply pixel to film coordinates affine transform:
355  //***
356  ossimDpt p1 (p0 - theRefImgPt);
357  ossimDpt f1 (theScanXformMatrix[0]*p1.x + theScanXformMatrix[1]*p1.y,
358  theScanXformMatrix[2]*p1.x + theScanXformMatrix[3]*p1.y);
359  ossimDpt film (f1 - thePrincipalPoint);
360  if (traceDebug() || debug)
361  {
362  ossimNotify(ossimNotifyLevel_DEBUG) << "theRefImgPt = " << theRefImgPt << std::endl;
363  ossimNotify(ossimNotifyLevel_DEBUG) << "p1 = " << p1 << std::endl;
364  for (int i=0; i<4; i++)
365  {
366  ossimNotify(ossimNotifyLevel_DEBUG) << "theScanXformMatrix["<<i<<"] = "<<theScanXformMatrix[i] << std::endl;
367  }
368  ossimNotify(ossimNotifyLevel_DEBUG) << "f1 = " << f1 << std::endl;
369  ossimNotify(ossimNotifyLevel_DEBUG) << "thePrincipalPoint = " << thePrincipalPoint << std::endl;
370  ossimNotify(ossimNotifyLevel_DEBUG) << "film (distorted) = " << film << std::endl;
371  }
372 
373  //***
374  // Correct film point for optical (radial, decentering) distortion:
375  //***
378  if (traceDebug() || debug)
379  {
380  ossimNotify(ossimNotifyLevel_DEBUG) << "film (undistorted) = " << film << std::endl;
382  {
384  }
385  }
386 
387  //***
388  // Establish image ray in camera-space (LSR) coordinates, then rotate to the
389  // ECF. This rotation contains interior orientation, exterior orientation,
390  // and attitude correction:
391  //***
392  ossimColumnVector3d cam_ray_dir (film.x, film.y, -theAdjFocalLen);
393  ossimEcefVector ecf_ray_dir (theAdjLsrToEcfRot*cam_ray_dir);
394  ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());
395  if (traceDebug() || debug)
396  {
397  ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjFocalLen = " << theAdjFocalLen << std::endl;
398  ossimNotify(ossimNotifyLevel_DEBUG) << "cam_ray_dir = " << cam_ray_dir << std::endl;
399  ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjLsrToEcfRot = \n" << theAdjLsrToEcfRot << std::endl;
400  ossimNotify(ossimNotifyLevel_DEBUG) << "ecf_ray_dir = " << ecf_ray_dir << std::endl;
401  }
402 
403  //***
404  // Establish ECF Ray object to represent imaging ray:
405  //***
406  image_ray.setOrigin(theAdjPlatformPos);
407  image_ray.setDirection(ecf_ray_dir);
408  if (traceDebug() || debug)
409  {
410  ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjPlatformPos = " << theAdjPlatformPos << std::endl;
411  ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjPlatformPos (ossimGpt): " << ossimGpt(theAdjPlatformPos)
412  << std::endl;
413  ossimNotify(ossimNotifyLevel_DEBUG) << "image_ray = " << image_ray << std::endl;
414  }
415 
416  if (traceExec() || debug) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::imagingRay: returning..." << std::endl;
417 }
ossimRadialDecentLensDistortion * theOpticalDistortion
void setOrigin(const ossimEcefPoint &orig)
Definition: ossimEcefRay.h:81
ossimDpt theSubImageOffset
ossimEcefPoint theAdjPlatformPos
virtual void inverse(const ossimDpt &input, ossimDpt &output) const
virtual std::ostream & print(std::ostream &out) const
NEWMAT::Matrix theAdjLsrToEcfRot
ossimDpt thePrincipalPoint
void setDirection(const ossimEcefVector &d)
Definition: ossimEcefRay.h:82
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
double theScanXformMatrix[4]

◆ initAdjustableParameters()

void ossimFcsiModel::initAdjustableParameters ( )
protectedvirtual

Assigns initial default values to adjustable parameters and related members.

{

Reimplemented from ossimAdjustableParameterInterface.

Definition at line 958 of file ossimFcsiModel.cpp.

959 {
960  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::initAdjustableParameters: entering..." << std::endl;
961 
962  int numParams = NUM_ADJUSTABLE_PARAMS;
964 
965 // if(!getNumberOfAdjustableParameters())
967  //***
968  // Allocate storage for adjustables and assign their names and units strings
969  //***
970 // newAdjustment(NUM_ADJUSTABLE_PARAMS);
971 // }
972  //***
973  // Initialize base-class adjustable parameter array:
974  //***
975  for (int i=0; i<numParams; i++)
976  {
977  setAdjustableParameter(i, 0.0);
978  setParameterDescription(i, PARAM_NAMES[i]);
979  setParameterUnit(i, PARAM_UNITS[i]);
980  }
981 
982  //***
983  // Initialize base-class parameter sigma array:
984  //***
985  setParameterSigma(X_POS, 50.0);
986  setParameterSigma(Y_POS, 50.0);
987  setParameterSigma(Z_POS, 50.0);
988  setParameterSigma(X_ROT, 0.01);
989  setParameterSigma(Y_ROT, 0.01);
990  setParameterSigma(Z_ROT, 0.01);
993 
994  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::initAdjustableParameters: returning..." << std::endl;
995 }
void setParameterDescription(ossim_uint32 idx, const ossimString &descrption)
void setParameterUnit(ossim_uint32 idx, ossimUnitType unit)
virtual void setAdjustableParameter(ossim_uint32 idx, double value, bool notify=false)
void resizeAdjustableParameterArray(ossim_uint32 numberOfParameters)
void setParameterSigma(ossim_uint32 idx, double value, bool notify=false)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ lineSampleHeightToWorld()

void ossimFcsiModel::lineSampleHeightToWorld ( const ossimDpt image_point,
const double &  heightEllipsoid,
ossimGpt worldPoint 
) const
virtual

Overrides base class pure virtual.

Implements ossimSensorModel.

Definition at line 283 of file ossimFcsiModel.cpp.

286 {
287  bool debug = false; // setable via interactive debugger
288  if (traceExec() || debug) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
289 
290  //***
291  // Extrapolate if point is outside image:
292  //***
293  if (!insideImage(image_point))
294  {
295  gpt = extrapolate(image_point, height);
296  }
297 
298  else
299  {
300  //***
301  // First establish imaging ray from image point:
302  //***
303  ossimEcefRay imaging_ray;
304  imagingRay(image_point, imaging_ray);
305  ossimEcefPoint Pecf (imaging_ray.intersectAboveEarthEllipsoid(height));
306  gpt = ossimGpt(Pecf);
307 
308  if (traceDebug() || debug)
309  {
310  ossimNotify(ossimNotifyLevel_DEBUG) << "Pecf = " << Pecf << std::endl;
311  ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
312  }
313  }
314 
315  if (traceExec() || debug) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: returning..." << std::endl;
316 }
ossimEcefPoint intersectAboveEarthEllipsoid(const double &heightAboveEllipsoid, const ossimDatum *aDatum=ossimDatumFactory::instance() ->wgs84()) const
virtual void imagingRay(const ossimDpt &image_point, ossimEcefRay &image_ray) const
virtual ossimDpt extrapolate(const ossimGpt &gp) const
virtual bool insideImage(const ossimDpt &p) const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ loadState()

bool ossimFcsiModel::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of the object from a keyword list. Return true if ok or false on error.

Reimplemented from ossimSensorModel.

Definition at line 626 of file ossimFcsiModel.cpp.

628 {
629  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::loadState: entering..." << std::endl;
630 
631  if (traceDebug())
632  {
634  << "\nInput kwl: " << kwl
635  << std::endl;
636  }
637 
638  const char* value;
639  const char* keyword;
640  bool success;
641 
642  //***
643  // Assure this keywordlist contains correct type info:
644  //***
645  keyword = ossimKeywordNames::TYPE_KW;
646  value = kwl.find(prefix, keyword);
647  if (!value)
648  {
651  "Type name not found");
652  return false;
653 
654  }
655  if (strcmp(value, TYPE_NAME(this)))
656  {
657  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::saveState: returning..." << std::endl;
658  return false;
659  }
660 
661  //***
662  // Clear out any existing adjustable params:
663  //***
664 
665  //***
666  // Pass on to the base-class for parsing first:
667  //***
668  success = ossimSensorModel::loadState(kwl, prefix);
669  if (!success)
670  {
671  return false;
672  }
674  {
676  }
677 
678  //***
679  // Now begin loading data members:
680  //***
681  keyword = PRINCIPAL_POINT_X_KW;
682  value = kwl.find(prefix, keyword);
683  if (!value)
684  {
687  "principle point x not given");
688  return false;
689  }
690  thePrincipalPoint.x = atof(value);
691 
692  keyword = PRINCIPAL_POINT_Y_KW;
693  value = kwl.find(prefix, keyword);
694  if (!value)
695  {
698  "principle point y not given");
699  return false;
700  }
701 
702  thePrincipalPoint.y = atof(value);
703 
704  keyword = SCAN_SCALE_MATRIX_00_KW;
705  value = kwl.find(prefix, keyword);
706  if (!value)
707  {
710  "scale matrix 0,0 not given");
711  return false;
712  }
713  theScanScaleMatrix[0] = atof(value);
714 
715  keyword = SCAN_SCALE_MATRIX_01_KW;
716  value = kwl.find(prefix, keyword);
717  if (!value)
718  {
721  "scale matrix 0,1 not given");
722  return false;
723  }
724  theScanScaleMatrix[1] = atof(value);
725 
726  keyword = SCAN_SCALE_MATRIX_10_KW;
727  value = kwl.find(prefix, keyword);
728  if (!value)
729  {
732  "scale matrix 1,0 not given");
733  return false;
734  }
735  theScanScaleMatrix[2] = atof(value);
736 
737  keyword = SCAN_SCALE_MATRIX_11_KW;
738  value = kwl.find(prefix, keyword);
739  if (!value)
740  {
743  "scale matrix 1,1 not given");
744  return false;
745  }
746  theScanScaleMatrix[3] = atof(value);
747 
748  keyword = SCAN_SKEW_ANGLE_KW;
749  value = kwl.find(prefix, keyword);
750  if (!value)
751  theScanSkew = 0.0;
752  else
753  theScanSkew = atof(value);
754 
755  keyword = SCAN_ROTATION_ANGLE_KW;
756  value = kwl.find(prefix, keyword);
757  if (!value)
758  theScanRotation = 0.0;
759  else
760  theScanRotation = atof(value);
761 
762  keyword = FOCAL_LENGTH_KW;
763  value = kwl.find(prefix, keyword);
764  if (!value)
765  {
768  "Focal length not given");
769  return false;
770  }
771  theFocalLen = atof(value);
772 
773  keyword = PLATFORM_POSITION_X_KW;
774  value = kwl.find(prefix, keyword);
775  if (!value)
776  {
779  "Platform position X not given");
780  return false;
781  }
782  thePlatformPos.x() = atof(value);
783 
784  keyword = PLATFORM_POSITION_Y_KW;
785  value = kwl.find(prefix, keyword);
786  if (!value)
787  {
790  "Platform position Y not given");
791  }
792  thePlatformPos.y() = atof(value);
793 
794  keyword = PLATFORM_POSITION_Z_KW;
795  value = kwl.find(prefix, keyword);
796  if (!value)
797  {
800  "Platform position Z not given");
801  }
802  thePlatformPos.z() = atof(value);
803 
804  //***
805  // Platform orientation matrix:
806  //***
807  for (int i=0; i<3; i++)
808  {
809  for (int j=0; j<3; j++)
810  {
811  ostringstream ostr;
813  << i << "_" << j << ends;
814  ossimString s = ostr.str();
815  keyword = s.c_str();
816  value = kwl.find(prefix, keyword);
817  if (!value)
818  {
821  "Camera orientation matrix not given");
822  }
823  theLsrToEcfRot[i][j] = ossimString(value).toDouble();
824  }
825  }
826 
827  //***
828  // Reading of optical distortion coefficients is left to the service object:
829  //***
831  delete theOpticalDistortion;
833 
834  //***
835  // Initialize given parameters read:
836  //***
838  updateModel();
839 
840  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::loadState: returning..." << std::endl;
841  return true;
842 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
static const char * FOCAL_LENGTH_KW
#define TYPE_NAME(p)
Definition: ossimRtti.h:326
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
static const char * PLATFORM_POSITION_Y_KW
virtual void updateModel()
const char * find(const char *key) const
static const char * PRINCIPAL_POINT_X_KW
double y
Definition: ossimDpt.h:165
NEWMAT::Matrix theLsrToEcfRot
static const char * PRINCIPAL_POINT_Y_KW
double x() const
ossimRadialDecentLensDistortion * theOpticalDistortion
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
static const char * SCAN_ROTATION_ANGLE_KW
static const char * TYPE_KW
static const char * PLATFORM_POSITION_Z_KW
double theScanScaleMatrix[4]
static const char * CAMERA_ORIENTATION_MATRIX_ELEM_KW
static const char * SCAN_SCALE_MATRIX_11_KW
double toDouble() const
static const char * PLATFORM_POSITION_X_KW
void initAdjustableParameters()
static const char * SCAN_SCALE_MATRIX_00_KW
double y() const
double x
Definition: ossimDpt.h:164
ossimEcefPoint thePlatformPos
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
double theScanRotation
ossimDpt thePrincipalPoint
double z() const
static const char * SCAN_SKEW_ANGLE_KW
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
static const char * SCAN_SCALE_MATRIX_01_KW
static const char * SCAN_SCALE_MATRIX_10_KW

◆ print()

std::ostream & ossimFcsiModel::print ( std::ostream &  out) const
virtual

Extends base-class implementation. Dumps contents of object to ostream.

Reimplemented from ossimSensorModel.

Definition at line 516 of file ossimFcsiModel.cpp.

References ossimSensorModel::print(), theAdjLsrToEcfRot, theEcfOffset, theFocalLen, theFocalOffset, theLsrToEcfRot, theOpticalDistortion, thePlatformPos, thePrincipalPoint, theScanRotation, theScanScaleMatrix, theScanSkew, theScanSkewCorr, theScanXformMatrix, theXrotCorr, theYrotCorr, and theZrotCorr.

517 {
518  out << "\nDump of ossimFcsiModel object at " << hex << this << ":\n"
519  << "\nossimFcsiModel data members: "
520  << "\n thePrincipalPoint: " << thePrincipalPoint
521  << "\n theScanScaleMatrix: " << theScanScaleMatrix[0] << " "
522  << theScanScaleMatrix[1]
523  << "\n " << theScanScaleMatrix[2] << " "
524  << theScanScaleMatrix[3]
525  << "\n theScanSkew: " << theScanSkew
526  << "\n theScanRotation: " << theScanRotation;
527 
528  for (int i=0; i<4; ++i)
529  {
530  out << "\ntheScanXformMatrix["<<i<<"]: " << theScanXformMatrix[i];
531  }
532 
533  out << "\n theFocalLen: " << theFocalLen
534  << "\n thePlatformPos: " << thePlatformPos
535  << "\n theLsrToEcfRot: \n" << theLsrToEcfRot
536  << "\n theAdjLsrToEcfRot: \n" << theAdjLsrToEcfRot
537  << "\n theEcfOffset: " << theEcfOffset
538  << "\n theXrotCorr: " << theXrotCorr
539  << "\n theYrotCorr: " << theYrotCorr
540  << "\n theZrotCorr: " << theZrotCorr
541  << "\n theFocalOffset: " << theFocalOffset
542  << "\n theScanSkewCorr: " << theScanSkewCorr
543  << endl;
544 
546  {
547  out << *theOpticalDistortion << endl;
548  }
549 
550  return ossimSensorModel::print(out);
551 }
double theScanSkewCorr
ossimEcefVector theEcfOffset
NEWMAT::Matrix theLsrToEcfRot
ossimRadialDecentLensDistortion * theOpticalDistortion
double theScanScaleMatrix[4]
virtual std::ostream & print(std::ostream &out) const
NEWMAT::Matrix theAdjLsrToEcfRot
ossimEcefPoint thePlatformPos
double theScanRotation
ossimDpt thePrincipalPoint
double theScanXformMatrix[4]

◆ saveState()

bool ossimFcsiModel::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Fulfills ossimObject base-class pure virtuals. Loads and saves geometry KWL files. Returns true if successful.

Reimplemented from ossimSensorModel.

Definition at line 559 of file ossimFcsiModel.cpp.

561 {
562  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::saveState: entering..." << std::endl;
563 
564  kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimFcsiModel");
565 
566  //***
567  // Hand off to base class for common stuff:
568  //***
569  ossimSensorModel::saveState(kwl, prefix);
570 
571  //***
572  // Save off data members:
573  //***
580  kwl.add(prefix, SCAN_SKEW_ANGLE_KW, theScanSkew);
582  kwl.add(prefix, FOCAL_LENGTH_KW, theFocalLen);
583  kwl.add(prefix, PLATFORM_POSITION_X_KW,
584  thePlatformPos.x());
585  kwl.add(prefix, PLATFORM_POSITION_Y_KW,
586  thePlatformPos.y());
587  kwl.add(prefix, PLATFORM_POSITION_Z_KW,
588  thePlatformPos.z());
589 
590  //***
591  // Camera orientation matrix:
592  // i is row and j is column
593  //***
594  for (int i=0; i<3; i++)
595  {
596  for (int j=0; j<3; j++)
597  {
598  ostringstream ostr;
600  << i << "_" << j << ends;
601  kwl.add(prefix, ostr.str().c_str(), theLsrToEcfRot[i][j]);
602  }
603  }
604 
605  //***
606  // Optical distortion coefficients:
607  //***
609  {
610  ostringstream ostr;
611  ostr << prefix << "distortion." << ends;
612  theOpticalDistortion->saveState(kwl, ostr.str().c_str());
613  }
614 
615  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::saveState: returning..." << std::endl;
616  return true;
617 }
static const char * FOCAL_LENGTH_KW
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
static const char * PLATFORM_POSITION_Y_KW
static const char * PRINCIPAL_POINT_X_KW
double y
Definition: ossimDpt.h:165
NEWMAT::Matrix theLsrToEcfRot
static const char * PRINCIPAL_POINT_Y_KW
double x() const
ossimRadialDecentLensDistortion * theOpticalDistortion
static const char * SCAN_ROTATION_ANGLE_KW
static const char * TYPE_KW
static const char * PLATFORM_POSITION_Z_KW
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
double theScanScaleMatrix[4]
static const char * CAMERA_ORIENTATION_MATRIX_ELEM_KW
static const char * SCAN_SCALE_MATRIX_11_KW
static const char * PLATFORM_POSITION_X_KW
static const char * SCAN_SCALE_MATRIX_00_KW
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
double y() const
double x
Definition: ossimDpt.h:164
ossimEcefPoint thePlatformPos
double theScanRotation
ossimDpt thePrincipalPoint
double z() const
static const char * SCAN_SKEW_ANGLE_KW
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
static const char * SCAN_SCALE_MATRIX_01_KW
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
static const char * SCAN_SCALE_MATRIX_10_KW

◆ updateModel()

void ossimFcsiModel::updateModel ( )
virtual

Following a change to the adjustable parameter set, this virtual is called to permit instances to compute derived quantities after parameter change.

Reimplemented from ossimSensorModel.

Definition at line 851 of file ossimFcsiModel.cpp.

852 {
853  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::updateModel: entering..." << std::endl;
854 
855  //***
856  // Update the geometry...
857  // Adjusted = Initial + adj_parm[i]*adj_sigma[i]
858  // Some parameters have a zero initial value and that term is not included.
859  //***
876 
877  //***
878  // Compute adjusted quatities used in projection code:
879  //***
882 
883  //***
884  // Establish the Scanner to film transform matrix.
885  //
886  // NOTE FOR IMPLEMENTING PARAMETER ADJUSTMENT: while the scan skew
887  // angle is an adjustable parameter, the pixel scaling is not since this
888  // error can be absorbed by the focal length adjustment, though the sigma
889  // for the focal length must be inflated to account for the additional error
890  // source. A similar situation occurrs with the scan rotation which manifests
891  // as an attitude adjustment.
892  //***
893  double cos_rot = ossim::cosd(theScanRotation);
894  double sin_rot = ossim::sind(theScanRotation);
895  double tan_skew = ossim::tand(theScanSkew + theScanSkewCorr);
896 
897  double a = theScanScaleMatrix[0]*(sin_rot*tan_skew + cos_rot) +
898  theScanScaleMatrix[1]*(cos_rot*tan_skew - sin_rot);
899  double b = theScanScaleMatrix[0]*sin_rot + theScanScaleMatrix[1]*cos_rot;
900  double c = theScanScaleMatrix[2]*(sin_rot*tan_skew + cos_rot) +
901  theScanScaleMatrix[3]*(cos_rot*tan_skew - sin_rot);
902  double d = theScanScaleMatrix[2]*sin_rot + theScanScaleMatrix[3]*cos_rot;
903 
904  theScanXformMatrix[0] = a;
905  theScanXformMatrix[1] = b;
906  theScanXformMatrix[2] = c;
907  theScanXformMatrix[3] = d;
908 
909  //***
910  // The inverse of the scanner-to-film transform must be computed since it is
911  // not an orthogonal matrix (inverse != transpose):
912  //***
913  theInvScanXformMatrix[0] = d/(d*a - b*c);
914  theInvScanXformMatrix[1] = -b/(d*a - b*c);
915  theInvScanXformMatrix[2] = c/(b*c - a*d);
916  theInvScanXformMatrix[3] = -a/(b*c - a*d);
917 
918  //***
919  // Establish the differential rotation matrix due to attitude correction:
920  //***
921  double cw = ossim::cosd(theXrotCorr);
922  double sw = ossim::sind(theXrotCorr);
923  double cp = ossim::cosd(theYrotCorr);
924  double sp = ossim::sind(theYrotCorr);
925  double ck = ossim::cosd(theZrotCorr);
926  double sk = ossim::sind(theZrotCorr);
927 
928  NEWMAT::Matrix attitudeCorrection(3, 3);
929  attitudeCorrection(1,1) = ck*cw - sk*sp*sw;
930  attitudeCorrection(1,2) = sk*cp;
931  attitudeCorrection(1,3) = ck*sw + sk*sp*cw;
932  attitudeCorrection(2,1) = -sk*cw - ck*sp*sw;
933  attitudeCorrection(2,2) = cp*ck;
934  attitudeCorrection(2,3) = -sk*sw + ck*sp*cw;
935  attitudeCorrection(3,1) = -cp*sw;
936  attitudeCorrection(3,2) = -sp;
937  attitudeCorrection(3,3) = cp*cw;
938 
939  //***
940  // Now compute the final LSR to ECF rotation:
941  //***
942  theAdjLsrToEcfRot = attitudeCorrection * theLsrToEcfRot;
944 
945  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::updateModel: returning..." << std::endl;
946 }
double z() const
double theScanSkewCorr
ossimEcefVector theEcfOffset
NEWMAT::Matrix theAdjEcfToLsrRot
NEWMAT::Matrix theLsrToEcfRot
double sind(double x)
Definition: ossimCommon.h:260
double tand(double x)
Definition: ossimCommon.h:261
ossimEcefPoint theAdjPlatformPos
double theScanScaleMatrix[4]
double theInvScanXformMatrix[4]
double cosd(double x)
Definition: ossimCommon.h:259
double x() const
NEWMAT::Matrix theAdjLsrToEcfRot
double y() const
ossimEcefPoint thePlatformPos
double theScanRotation
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
double theScanXformMatrix[4]

◆ useForward()

virtual bool ossimFcsiModel::useForward ( ) const
inlinevirtual

ossimOptimizableProjection

Implements ossimOptimizableProjection.

Definition at line 181 of file ossimFcsiModel.h.

181 {return true;}

◆ worldToLineSample()

void ossimFcsiModel::worldToLineSample ( const ossimGpt world_point,
ossimDpt image_point 
) const
virtual

Rigorous inverse transform implented, overrides base-class' iterative solution.

Reimplemented from ossimSensorModel.

Definition at line 426 of file ossimFcsiModel.cpp.

428 {
429  bool debug = false; // setable via interactive debugger: "set debug = true"
430  if (traceExec() || debug) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::imagingRay: entering..." << std::endl;
431 
432  //***
433  // Establish ECF ray from platform to ground point and rotate to platform LSR
434  //***
435  ossimEcefPoint g_ecf (world_point);
436  ossimEcefVector ecf_ray_dir (g_ecf - theAdjPlatformPos);
437  ossimColumnVector3d cam_ray_dir (theAdjEcfToLsrRot*ecf_ray_dir.data());
438 
439  if (traceDebug() || debug)
440  {
441  ossimNotify(ossimNotifyLevel_DEBUG)<<"world_point = " << world_point << endl;
442  ossimNotify(ossimNotifyLevel_DEBUG)<<"g_ecf = " << g_ecf << endl;
443  ossimNotify(ossimNotifyLevel_DEBUG)<<"theAdjPlatformPos = " << theAdjPlatformPos << endl;
444  ossimNotify(ossimNotifyLevel_DEBUG)<<"theAdjPlatformPos (ossimGpt): "<<ossimGpt(theAdjPlatformPos)<<endl;
445  ossimNotify(ossimNotifyLevel_DEBUG)<<"ecf_ray_dir = " << ecf_ray_dir.unitVector() << endl;
446  ossimNotify(ossimNotifyLevel_DEBUG)<<"theAdjEcfToLsrRot = \n" << theAdjEcfToLsrRot << endl;
447  ossimNotify(ossimNotifyLevel_DEBUG)<<"cam_ray_dir = " << cam_ray_dir << endl;
448  }
449 
450  //***
451  // Scale the direction vector by the focal length to arrive at film
452  // coordinates:
453  //***
454  double scale = -theAdjFocalLen/cam_ray_dir[2];
455  ossimDpt film (scale*cam_ray_dir[0], scale*cam_ray_dir[1]);
456 
457  if (traceDebug() || debug)
458  {
459  ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjFocalLen = " << theAdjFocalLen << endl;
460  ossimNotify(ossimNotifyLevel_DEBUG) << "scale = " << scale << endl;
461  ossimNotify(ossimNotifyLevel_DEBUG) << "film (undistorted) = " << film << endl;
462  }
463 
464  //***
465  // Add distortion:
466  //***
469 
470  if (traceDebug() || debug)
471  {
472  ossimNotify(ossimNotifyLevel_DEBUG) << "film (distorted) = " << film << endl;
473  }
474 
475  //***
476  // Apply film to pixel coordinates affine transform:
477  //***
478  ossimDpt f1(film + thePrincipalPoint);
481  ossimDpt p0 (p1 + theRefImgPt);
482 
483  if (traceDebug() || debug)
484  {
485  ossimNotify(ossimNotifyLevel_DEBUG) << "thePrincipalPoint = " << thePrincipalPoint << endl;
486  ossimNotify(ossimNotifyLevel_DEBUG) << "f1 = " << f1 << endl;
487  for (int i=0; i<4; i++)
488  ossimNotify(ossimNotifyLevel_DEBUG)<<"theInvScanXformMatrix["<<i<<"] = "<<theInvScanXformMatrix[i]
489  <<endl;
490  ossimNotify(ossimNotifyLevel_DEBUG) << "p1 = " << p1 << endl;
491  ossimNotify(ossimNotifyLevel_DEBUG) << "theRefImgPt = " << theRefImgPt << endl;
492  ossimNotify(ossimNotifyLevel_DEBUG) << "p0 = " << p0 << endl;
493  }
494 
495  //***
496  // Finally, apply the sub-image offset to get to digital image coordinates:
497  //***
498  image_point = p0 - theSubImageOffset;
499 
500  if (traceDebug() || debug)
501  {
502  ossimNotify(ossimNotifyLevel_DEBUG) << "theImageOffset = " << theSubImageOffset << endl;
503  ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << endl;
504  }
505 
506  if (traceExec() || debug) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::imagingRay: returning..." << std::endl;
507 }
virtual void forward(const ossimDpt &undistorted_point_in, ossimDpt &distorted_point_out) const
NEWMAT::Matrix theAdjEcfToLsrRot
ossimRadialDecentLensDistortion * theOpticalDistortion
ossimDpt theSubImageOffset
ossimEcefPoint theAdjPlatformPos
double theInvScanXformMatrix[4]
ossimDpt thePrincipalPoint
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ writeGeomTemplate()

void ossimFcsiModel::writeGeomTemplate ( ostream &  os)
static

Writes a template of geom keywords processed by loadState and saveState to output stream.

Definition at line 1004 of file ossimFcsiModel.cpp.

1005 {
1006  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::writeGeomTemplate: entering..." << std::endl;
1007 
1008  os <<
1009  "//*****************************************************************\n"
1010  "// Template for Frame Camera Scanned Image (FCSI) model keywordlist\n"
1011  "//*****************************************************************\n"
1012  << ossimKeywordNames::TYPE_KW << ": " << "ossimFcsiModel" << endl;
1013 
1015 
1016  os << "//***\n"
1017  << "// Derived-class FCSI Keywords:\n"
1018  << "//***\n"
1019  << PRINCIPAL_POINT_X_KW << ": <pixels>\n"
1020  << PRINCIPAL_POINT_Y_KW << ": <pixels>\n"
1021  << SCAN_SCALE_MATRIX_00_KW << ": <mm/pixel>\n"
1022  << SCAN_SCALE_MATRIX_01_KW << ": <mm/pixel>\n"
1023  << SCAN_SCALE_MATRIX_10_KW << ": <mm/pixel>\n"
1024  << SCAN_SCALE_MATRIX_11_KW << ": <mm/pixel>\n"
1025  << SCAN_SKEW_ANGLE_KW << ": <degrees> [OPTIONAL]\n"
1026  << SCAN_ROTATION_ANGLE_KW << ": <degrees> [OPTIONAL]\n"
1027  << FOCAL_LENGTH_KW << ": <millimeters>\n"
1028  << PLATFORM_POSITION_X_KW << ": <meters (ECF)>\n"
1029  << PLATFORM_POSITION_Y_KW << ": <meters (ECF)>\n"
1030  << PLATFORM_POSITION_Z_KW << ": <meters (ECF)>\n"
1031  << "\n"
1032  << "//***\n"
1033  << "// Camera (LSR) to ECF orientation matrix:\n"
1034  << "//***\n";
1035 
1036  for (int i=0; i<3; i++)
1037  {
1038  for (int j=0; j<3; j++)
1039  {
1040  ostringstream ostr;
1042  << i << "_" << j << ends;
1043  os << ostr.str() << ": <Euler rot matrix element>\n";
1044  }
1045  }
1046 
1047  os << "\n"
1048  << "//***\n"
1049  << "// Optical distortion coefficients [OPTIONAL]:\n"
1050  << "//***\n"
1051  << "distortion."
1053  << "N: <coeff N> (for N <= 5)\n"
1054  << "distortion."
1056  << "N: <coeff N> (for N <= 4)\n"
1057  << endl;
1058 
1059  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::writeGeomTemplate: returning..." << std::endl;
1060 
1061  return;
1062 }
static const char * FOCAL_LENGTH_KW
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
static const char * PLATFORM_POSITION_Y_KW
static const char * PRINCIPAL_POINT_X_KW
static const char * PRINCIPAL_POINT_Y_KW
static const char * SCAN_ROTATION_ANGLE_KW
static const char * TYPE_KW
static const char * PLATFORM_POSITION_Z_KW
static const char * CAMERA_ORIENTATION_MATRIX_ELEM_KW
static const char * SCAN_SCALE_MATRIX_11_KW
static const char * PLATFORM_POSITION_X_KW
static const char * SCAN_SCALE_MATRIX_00_KW
static void writeGeomTemplate(ostream &os)
static const char * SCAN_SKEW_ANGLE_KW
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
static const char * SCAN_SCALE_MATRIX_01_KW
static const char * SCAN_SCALE_MATRIX_10_KW

Member Data Documentation

◆ CAMERA_ORIENTATION_MATRIX_ELEM_KW

const char * ossimFcsiModel::CAMERA_ORIENTATION_MATRIX_ELEM_KW = "camera_orientation_matrix_elem_"
static

Definition at line 176 of file ossimFcsiModel.h.

◆ FOCAL_LENGTH_KW

const char * ossimFcsiModel::FOCAL_LENGTH_KW = "focal_length"
static

Definition at line 172 of file ossimFcsiModel.h.

◆ PLATFORM_POSITION_X_KW

const char * ossimFcsiModel::PLATFORM_POSITION_X_KW = "platform_position_x"
static

Definition at line 173 of file ossimFcsiModel.h.

◆ PLATFORM_POSITION_Y_KW

const char * ossimFcsiModel::PLATFORM_POSITION_Y_KW = "platform_position_y"
static

Definition at line 174 of file ossimFcsiModel.h.

◆ PLATFORM_POSITION_Z_KW

const char * ossimFcsiModel::PLATFORM_POSITION_Z_KW = "platform_position_z"
static

Definition at line 175 of file ossimFcsiModel.h.

◆ PRINCIPAL_POINT_X_KW

const char * ossimFcsiModel::PRINCIPAL_POINT_X_KW = "principal_point_x"
static

Global keywords for use by this model:

Definition at line 164 of file ossimFcsiModel.h.

◆ PRINCIPAL_POINT_Y_KW

const char * ossimFcsiModel::PRINCIPAL_POINT_Y_KW = "principal_point_y"
static

Definition at line 165 of file ossimFcsiModel.h.

◆ SCAN_ROTATION_ANGLE_KW

const char * ossimFcsiModel::SCAN_ROTATION_ANGLE_KW = "scan_rotation_angle"
static

Definition at line 171 of file ossimFcsiModel.h.

◆ SCAN_SCALE_MATRIX_00_KW

const char * ossimFcsiModel::SCAN_SCALE_MATRIX_00_KW = "scan_scale_matrix_00"
static

Definition at line 166 of file ossimFcsiModel.h.

◆ SCAN_SCALE_MATRIX_01_KW

const char * ossimFcsiModel::SCAN_SCALE_MATRIX_01_KW = "scan_scale_matrix_01"
static

Definition at line 167 of file ossimFcsiModel.h.

◆ SCAN_SCALE_MATRIX_10_KW

const char * ossimFcsiModel::SCAN_SCALE_MATRIX_10_KW = "scan_scale_matrix_10"
static

Definition at line 168 of file ossimFcsiModel.h.

◆ SCAN_SCALE_MATRIX_11_KW

const char * ossimFcsiModel::SCAN_SCALE_MATRIX_11_KW = "scan_scale_matrix_11"
static

Definition at line 169 of file ossimFcsiModel.h.

◆ SCAN_SKEW_ANGLE_KW

const char * ossimFcsiModel::SCAN_SKEW_ANGLE_KW = "scan_skew_angle"
static

Definition at line 170 of file ossimFcsiModel.h.

◆ theAdjEcfToLsrRot

NEWMAT::Matrix ossimFcsiModel::theAdjEcfToLsrRot
protected

Definition at line 231 of file ossimFcsiModel.h.

◆ theAdjFocalLen

double ossimFcsiModel::theAdjFocalLen
protected

Definition at line 229 of file ossimFcsiModel.h.

◆ theAdjLsrToEcfRot

NEWMAT::Matrix ossimFcsiModel::theAdjLsrToEcfRot
protected

Definition at line 230 of file ossimFcsiModel.h.

Referenced by print().

◆ theAdjPlatformPos

ossimEcefPoint ossimFcsiModel::theAdjPlatformPos
protected

Definition at line 228 of file ossimFcsiModel.h.

◆ theEcfOffset

ossimEcefVector ossimFcsiModel::theEcfOffset
protected

Definition at line 218 of file ossimFcsiModel.h.

Referenced by print().

◆ theFocalLen

double ossimFcsiModel::theFocalLen
protected

Definition at line 205 of file ossimFcsiModel.h.

Referenced by print().

◆ theFocalOffset

double ossimFcsiModel::theFocalOffset
protected

Definition at line 222 of file ossimFcsiModel.h.

Referenced by print().

◆ theInvScanXformMatrix

double ossimFcsiModel::theInvScanXformMatrix[4]
protected

Definition at line 233 of file ossimFcsiModel.h.

◆ theLsrToEcfRot

NEWMAT::Matrix ossimFcsiModel::theLsrToEcfRot
protected

Definition at line 213 of file ossimFcsiModel.h.

Referenced by print().

◆ theOpticalDistortion

ossimRadialDecentLensDistortion* ossimFcsiModel::theOpticalDistortion
protected

Definition at line 206 of file ossimFcsiModel.h.

Referenced by print().

◆ thePlatformPos

ossimEcefPoint ossimFcsiModel::thePlatformPos
protected

Definition at line 212 of file ossimFcsiModel.h.

Referenced by print().

◆ thePrincipalPoint

ossimDpt ossimFcsiModel::thePrincipalPoint
protected

Definition at line 196 of file ossimFcsiModel.h.

Referenced by print().

◆ theScanRotation

double ossimFcsiModel::theScanRotation
protected

Definition at line 199 of file ossimFcsiModel.h.

Referenced by print().

◆ theScanScaleMatrix

double ossimFcsiModel::theScanScaleMatrix[4]
protected

Definition at line 197 of file ossimFcsiModel.h.

Referenced by print().

◆ theScanSkew

double ossimFcsiModel::theScanSkew
protected

Definition at line 198 of file ossimFcsiModel.h.

Referenced by print().

◆ theScanSkewCorr

double ossimFcsiModel::theScanSkewCorr
protected

Definition at line 223 of file ossimFcsiModel.h.

Referenced by print().

◆ theScanXformMatrix

double ossimFcsiModel::theScanXformMatrix[4]
protected

Definition at line 232 of file ossimFcsiModel.h.

Referenced by print().

◆ theXrotCorr

double ossimFcsiModel::theXrotCorr
protected

Definition at line 219 of file ossimFcsiModel.h.

Referenced by print().

◆ theYrotCorr

double ossimFcsiModel::theYrotCorr
protected

Definition at line 220 of file ossimFcsiModel.h.

Referenced by print().

◆ theZrotCorr

double ossimFcsiModel::theZrotCorr
protected

Definition at line 221 of file ossimFcsiModel.h.

Referenced by print().


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