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

#include <ossimApplanixEcefModel.h>

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

Public Member Functions

 ossimApplanixEcefModel ()
 
 ossimApplanixEcefModel (const ossimDrect &imageRect, const ossimGpt &platformPosition, double roll, double pitch, double heading, const ossimDpt &principalPoint, double focalLength, const ossimDpt &pixelSize)
 
 ossimApplanixEcefModel (const ossimApplanixEcefModel &src)
 
virtual ossimObjectdup () const
 
virtual void imagingRay (const ossimDpt &image_point, ossimEcefRay &image_ray) const
 
void lineSampleToWorld (const ossimDpt &image_point, ossimGpt &gpt) const
 
virtual void lineSampleHeightToWorld (const ossimDpt &image_point, const double &heightEllipsoid, ossimGpt &worldPoint) const
 
virtual void worldToLineSample (const ossimGpt &world_point, ossimDpt &image_point) const
 
virtual void updateModel ()
 
void setPrincipalPoint (ossimDpt principalPoint)
 
virtual bool insideImage (const ossimDpt &p) const
 
void setRollPitchHeading (double roll, double pitch, double heading)
 
void setPixelSize (const ossimDpt &pixelSize)
 
void setImageRect (const ossimDrect &rect)
 
void setFocalLength (double focalLength)
 
void setPlatformPosition (const ossimGpt &gpt)
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual void initAdjustableParameters ()
 
virtual bool useForward () const
 
virtual bool setupOptimizer (const ossimString &init_file)
 ground to image faster (you don't need DEM) More...
 
- 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 std::ostream & print (std::ostream &out) 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 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)
 
- 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...
 

Protected Attributes

NEWMAT::Matrix theCompositeMatrix
 uses file path to init model More...
 
NEWMAT::Matrix theCompositeMatrixInverse
 
double theRoll
 
double thePitch
 
double theHeading
 
ossimDpt thePrincipalPoint
 
ossimDpt thePixelSize
 
double theFocalLength
 
ossimEcefPoint theEcefPlatformPosition
 
ossimRefPtr< ossimMeanRadialLensDistortiontheLensDistortion
 
ossimEcefPoint theAdjEcefPlatformPosition
 
- 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
 

Additional Inherited Members

- 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
}
 
- Static Public Member Functions inherited from ossimSensorModel
static void writeGeomTemplate (ostream &os)
 
- 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...
 

Detailed Description

Definition at line 16 of file ossimApplanixEcefModel.h.

Constructor & Destructor Documentation

◆ ossimApplanixEcefModel() [1/3]

ossimApplanixEcefModel::ossimApplanixEcefModel ( )

Definition at line 34 of file ossimApplanixEcefModel.cpp.

References ossimMatrix4x4::createIdentity(), initAdjustableParameters(), theAdjEcefPlatformPosition, theCompositeMatrix, theCompositeMatrixInverse, theEcefPlatformPosition, theFocalLength, ossimSensorModel::theGSD, theHeading, theLensDistortion, ossimSensorModel::theMeanGSD, thePitch, thePixelSize, theRoll, ossimDpt::x, and ossimDpt::y.

Referenced by dup().

35 {
38  theRoll = 0.0;
39  thePitch = 0.0;
40  theHeading = 0.0;
41  theFocalLength = 55.0;
42  thePixelSize = ossimDpt(.009, .009);
43  theEcefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
44  theAdjEcefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
45  theGSD.x = 0.1524;
46  theGSD.y = 0.1524;
47  theMeanGSD = 0.1524;
50 
51  if (traceDebug())
52  {
54  << "ossimApplanixEcefModel::ossimApplanixEcefModel DEBUG:" << endl;
55 #ifdef OSSIM_ID_ENABLED
56  ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID: " << OSSIM_ID << endl;
57 #endif
58  }
59 }
ossimRefPtr< ossimMeanRadialLensDistortion > theLensDistortion
double y
Definition: ossimDpt.h:165
NEWMAT::Matrix theCompositeMatrixInverse
NEWMAT::Matrix theCompositeMatrix
uses file path to init model
ossimEcefPoint theAdjEcefPlatformPosition
ossimEcefPoint theEcefPlatformPosition
static NEWMAT::Matrix createIdentity()
double x
Definition: ossimDpt.h:164
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_float64 theMeanGSD

◆ ossimApplanixEcefModel() [2/3]

ossimApplanixEcefModel::ossimApplanixEcefModel ( const ossimDrect imageRect,
const ossimGpt platformPosition,
double  roll,
double  pitch,
double  heading,
const ossimDpt principalPoint,
double  focalLength,
const ossimDpt pixelSize 
)

Definition at line 60 of file ossimApplanixEcefModel.cpp.

References ossimSensorModel::computeGsd(), ossimMatrix4x4::createIdentity(), initAdjustableParameters(), ossimDrect::midPoint(), ossimNotify(), ossimNotifyLevel_WARN, theAdjEcefPlatformPosition, theCompositeMatrix, theCompositeMatrixInverse, theEcefPlatformPosition, theFocalLength, theHeading, ossimSensorModel::theImageClipRect, theLensDistortion, thePitch, thePixelSize, ossimSensorModel::theRefImgPt, theRoll, updateModel(), and ossimException::what().

68 {
69  theImageClipRect = imageRect;
73  theRoll = roll;
74  thePitch = pitch;
75  theHeading = heading;
76  theFocalLength = focalLength;
77  thePixelSize = pixelSize;
78  theEcefPlatformPosition = platformPosition;
79  theAdjEcefPlatformPosition = platformPosition;
82  updateModel();
83 
84  try
85  {
86  // Method throws ossimException.
87  computeGsd();
88  }
89  catch (const ossimException& e)
90  {
92  << "ossimApplanixEcefModel Constructor caught Exception:\n"
93  << e.what() << std::endl;
94  }
95 
96  if (traceDebug())
97  {
99  << "ossimApplanixEcefModel::ossimApplanixEcefModel DEBUG:" << endl;
100 #ifdef OSSIM_ID_ENABLED
101  ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID: " << OSSIM_ID << endl;
102 #endif
103  }
104 }
ossimRefPtr< ossimMeanRadialLensDistortion > theLensDistortion
NEWMAT::Matrix theCompositeMatrixInverse
NEWMAT::Matrix theCompositeMatrix
uses file path to init model
ossimEcefPoint theAdjEcefPlatformPosition
void computeGsd()
This method computes the ground sample distance(gsd) and sets class attributes theGSD and theMeanGSD ...
virtual const char * what() const
Returns the error message.
ossimEcefPoint theEcefPlatformPosition
ossimDrect theImageClipRect
static NEWMAT::Matrix createIdentity()
ossimDpt midPoint() const
Definition: ossimDrect.h:817
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ossimApplanixEcefModel() [3/3]

ossimApplanixEcefModel::ossimApplanixEcefModel ( const ossimApplanixEcefModel src)

Definition at line 106 of file ossimApplanixEcefModel.cpp.

References ossimRefPtr< T >::get(), initAdjustableParameters(), theLensDistortion, and ossimRefPtr< T >::valid().

107  :ossimSensorModel(src)
108 {
110 
111  if(src.theLensDistortion.valid())
112  {
114  }
115  else
116  {
118  }
119 }
ossimRefPtr< ossimMeanRadialLensDistortion > theLensDistortion
bool valid() const
Definition: ossimRefPtr.h:75

Member Function Documentation

◆ dup()

ossimObject * ossimApplanixEcefModel::dup ( ) const
virtual

Implements ossimProjection.

Definition at line 121 of file ossimApplanixEcefModel.cpp.

References ossimApplanixEcefModel().

122 {
123  return new ossimApplanixEcefModel(*this);
124 }

◆ imagingRay()

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

METHOD: imagingRay(image_point, &ossimEcefRay) Given an image point, returns a ray originating at some arbitrarily high point (ideally at the sensor position) and pointing towards the target. Implemented here but should be overriden for more efficient solution.

Reimplemented from ossimSensorModel.

Definition at line 126 of file ossimApplanixEcefModel.cpp.

References ossimEcefVector::magnitude(), ossimEcefRay::setDirection(), ossimEcefRay::setOrigin(), theAdjEcefPlatformPosition, theCompositeMatrix, theFocalLength, theLensDistortion, thePixelSize, thePrincipalPoint, ossimSensorModel::theRefImgPt, ossimMeanRadialLensDistortion::undistort(), ossimRefPtr< T >::valid(), ossimDpt::x, and ossimDpt::y.

Referenced by lineSampleHeightToWorld().

128 {
129 // if(traceDebug())
130 // {
131 // ossimNotify(ossimNotifyLevel_DEBUG) << "ossimApplanixEcefModel::imagingRay: ..... entered" << std::endl;
132 // }
133  ossimDpt f1 ((image_point) - theRefImgPt);
134  f1.x *= thePixelSize.x;
135  f1.y *= -thePixelSize.y;
136  ossimDpt film (f1 - thePrincipalPoint);
137 // if(traceDebug())
138 // {
139 // ossimNotify(ossimNotifyLevel_DEBUG) << "pixel size = " << thePixelSize << std::endl;
140 // ossimNotify(ossimNotifyLevel_DEBUG) << "principal pt = " << thePrincipalPoint << std::endl;
141 // ossimNotify(ossimNotifyLevel_DEBUG) << "film pt = " << film << std::endl;
142 // }
143  if (theLensDistortion.valid())
144  {
145  ossimDpt filmOut;
146  theLensDistortion->undistort(film, filmOut);
147  film = filmOut;
148  }
149 
150  ossimColumnVector3d cam_ray_dir (film.x,
151  film.y,
152  -theFocalLength);
153  ossimEcefVector ecf_ray_dir (theCompositeMatrix*cam_ray_dir);
154  ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());
155 
157  image_ray.setDirection(ecf_ray_dir);
158 
159 // if(traceDebug())
160 // {
161 // ossimNotify(ossimNotifyLevel_DEBUG) << "ossimApplanixEcefModel::imagingRay: ..... leaving" << std::endl;
162 // }
163 }
ossimRefPtr< ossimMeanRadialLensDistortion > theLensDistortion
bool valid() const
Definition: ossimRefPtr.h:75
double y
Definition: ossimDpt.h:165
void setOrigin(const ossimEcefPoint &orig)
Definition: ossimEcefRay.h:81
NEWMAT::Matrix theCompositeMatrix
uses file path to init model
ossimEcefPoint theAdjEcefPlatformPosition
virtual void undistort(const ossimDpt &input, ossimDpt &output) const
double x
Definition: ossimDpt.h:164
void setDirection(const ossimEcefVector &d)
Definition: ossimEcefRay.h:82

◆ initAdjustableParameters()

void ossimApplanixEcefModel::initAdjustableParameters ( )
virtual

Reimplemented from ossimAdjustableParameterInterface.

Definition at line 305 of file ossimApplanixEcefModel.cpp.

References ossimAdjustableParameterInterface::resizeAdjustableParameterArray(), ossimAdjustableParameterInterface::setAdjustableParameter(), ossimAdjustableParameterInterface::setParameterDescription(), ossimAdjustableParameterInterface::setParameterSigma(), and ossimAdjustableParameterInterface::setParameterUnit().

Referenced by ossimApplanixEcefModel().

306 {
307 
309 
310  setAdjustableParameter(0, 0.0);
311  setParameterDescription(0, "x_offset");
312  setParameterUnit(0, "pixels");
313 
314  setAdjustableParameter(1, 0.0);
315  setParameterDescription(1, "y_offset");
316  setParameterUnit(1, "pixels");
317 
318  setAdjustableParameter(2, 0.0);
319  setParameterDescription(2, "roll");
320  setParameterUnit(2, "degrees");
321 
322  setAdjustableParameter(3, 0.0);
323  setParameterDescription(3, "pitch");
324  setParameterUnit(3, "degrees");
325 
326  setAdjustableParameter(4, 0.0);
327  setParameterDescription(4, "heading");
328  setParameterUnit(4, "degrees");
329 
330  setAdjustableParameter(5, 0.0);
331  setParameterDescription(5, "altitude");
332  setParameterUnit(5, "meters");
333 
334 
335  setParameterSigma(0, 20.0);
336  setParameterSigma(1, 20.0);
337  setParameterSigma(2, .1);
338  setParameterSigma(3, .1);
339  setParameterSigma(4, .1);
340  setParameterSigma(5, 50);
341 }
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)

◆ insideImage()

virtual bool ossimApplanixEcefModel::insideImage ( const ossimDpt p) const
inlinevirtual

METHOD: insideImage(image_point) Returns true if the image_point lies inside the image rectangle.

Reimplemented from ossimSensorModel.

Definition at line 48 of file ossimApplanixEcefModel.h.

49  {
50  /* return( (p.u>=(0.0-FLT_EPSILON)) && */
51  /* (p.u<=(double)(theImageSize.u-(1-FLT_EPSILON))) && */
52  /* (p.v>=(0.0-FLT_EPSILON)) && */
53  /* (p.v<=(double)(theImageSize.v-(1-FLT_EPSILON))) ); */
54  // if it's close to the edge we will consider it inside the image
55  //
57  }
bool pointWithin(const ossimDpt &pt, double epsilon=0.0) const
Definition: ossimDrect.h:781
ossim_float64 width() const
Definition: ossimDrect.h:522
ossimDrect theImageClipRect

◆ lineSampleHeightToWorld()

void ossimApplanixEcefModel::lineSampleHeightToWorld ( const ossimDpt lineSampPt,
const double &  heightEllipsoid,
ossimGpt worldPt 
) const
virtual

METHOD: lineSampleHeightToWorld This is the pure virtual that performs the actual work of projecting the image point to the given elevation above Ellipsoid.

Implements ossimSensorModel.

Definition at line 204 of file ossimApplanixEcefModel.cpp.

References imagingRay(), and ossimEcefRay::intersectAboveEarthEllipsoid().

207 {
208 // if (!insideImage(image_point))
209 // {
210 // worldPoint.makeNan();
211 // worldPoint = extrapolate(image_point, heightEllipsoid);
212 // }
213 // else
214  {
215  //***
216  // First establish imaging ray from image point:
217  //***
218  ossimEcefRay ray;
219  imagingRay(image_point, ray);
220  ossimEcefPoint Pecf (ray.intersectAboveEarthEllipsoid(heightEllipsoid));
221  worldPoint = ossimGpt(Pecf);
222  }
223 }
ossimEcefPoint intersectAboveEarthEllipsoid(const double &heightAboveEllipsoid, const ossimDatum *aDatum=ossimDatumFactory::instance() ->wgs84()) const
virtual void imagingRay(const ossimDpt &image_point, ossimEcefRay &image_ray) const

◆ lineSampleToWorld()

void ossimApplanixEcefModel::lineSampleToWorld ( const ossimDpt image_point,
ossimGpt world_point 
) const
virtual

Implementation of base-class pure virtual projection methods. These methods may be overriden by derived classes if those have more efficient schemes. The implementations here are iterative (relatively slow). Both depend on calls to the pure virtual lineSampleHeightToWorld() method.

Reimplemented from ossimSensorModel.

Definition at line 165 of file ossimApplanixEcefModel.cpp.

Referenced by updateModel().

167 {
168  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimApplanixEcefModel::lineSampleToWorld:entering..." << std::endl;
169 
170  if(image_point.hasNans())
171  {
172  gpt.makeNan();
173  return;
174  }
175  //***
176  // Extrapolate if image point is outside image:
177  //***
178 // if (!insideImage(image_point))
179 // {
180 // gpt.makeNan();
181 // gpt = extrapolate(image_point);
182 // return;
183 // }
184 
185  //***
186  // Determine imaging ray and invoke elevation source object's services to
187  // intersect ray with terrain model:
188  //***
189  ossimEcefRay ray;
190  imagingRay(image_point, ray);
192 
193  if (traceDebug())
194  {
195  ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
196  ossimNotify(ossimNotifyLevel_DEBUG) << "ray = " << ray << std::endl;
197  ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
198  }
199 
200  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::lineSampleToWorld: returning..." << std::endl;
201  return;
202 }
bool intersectRay(const ossimEcefRay &ray, ossimGpt &gpt, double defaultElevValue=0.0)
METHOD: intersectRay()
static ossimElevManager * instance()
METHOD: instance() Implements singelton pattern.
virtual void imagingRay(const ossimDpt &image_point, ossimEcefRay &image_ray) const
bool hasNans() const
Definition: ossimDpt.h:67
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ loadState()

bool ossimApplanixEcefModel::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 411 of file ossimApplanixEcefModel.cpp.

Referenced by setupOptimizer().

413 {
414  if(traceDebug())
415  {
416  std::cout << "ossimApplanixEcefModel::loadState: ......... entered" << std::endl;
417  }
418 
419  theImageClipRect = ossimDrect(0,0,4076,4091);
420  theRefImgPt = ossimDpt(2046.0, 2038.5);
421 
422  ossimSensorModel::loadState(kwl, prefix);
424  {
426  }
427  theEcefPlatformPosition = ossimGpt(0.0,0.0,1000.0);
428  theAdjEcefPlatformPosition = ossimGpt(0.0,0.0,1000.0);
429  theRoll = 0.0;
430  thePitch = 0.0;
431  theHeading = 0.0;
432  // bool computeGsdFlag = false;
433  const char* roll = kwl.find(prefix, "roll");
434  const char* pitch = kwl.find(prefix, "pitch");
435  const char* heading = kwl.find(prefix, "heading");
436  const char* principal_point = kwl.find(prefix, "principal_point");
437  const char* pixel_size = kwl.find(prefix, "pixel_size");
438  const char* focal_length = kwl.find(prefix, "focal_length");
439  const char* ecef_platform_position = kwl.find(prefix, "ecef_platform_position");
440  const char* latlonh_platform_position = kwl.find(prefix, "latlonh_platform_position");
441  const char* compute_gsd_flag = kwl.find(prefix, "compute_gsd_flag");
442  const char* eo_file = kwl.find(prefix, "eo_file");
443  const char* camera_file = kwl.find(prefix, "camera_file");
444  const char* eo_id = kwl.find(prefix, "eo_id");
445  bool result = true;
446  if(eo_id)
447  {
448  theImageID = eo_id;
449  }
450  if(eo_file)
451  {
452  ossimApplanixEOFile eoFile;
453  if(eoFile.parseFile(ossimFilename(eo_file)))
454  {
456  if(record.valid())
457  {
458  ossim_int32 rollIdx = eoFile.getFieldIdx("ROLL");
459  ossim_int32 pitchIdx = eoFile.getFieldIdx("PITCH");
460  ossim_int32 headingIdx = eoFile.getFieldIdx("HEADING");
461  ossim_int32 xIdx = eoFile.getFieldIdx("X");
462  ossim_int32 yIdx = eoFile.getFieldIdx("Y");
463  ossim_int32 zIdx = eoFile.getFieldIdx("Z");
464 
465  if((rollIdx >= 0)&&
466  (pitchIdx >= 0)&&
467  (headingIdx >= 0)&&
468  (xIdx >= 0)&&
469  (yIdx >= 0)&&
470  (zIdx >= 0))
471  {
472  theRoll = (*record)[rollIdx].toDouble();
473  thePitch = (*record)[pitchIdx].toDouble();
474  theHeading = (*record)[headingIdx].toDouble();
475  theEcefPlatformPosition = ossimEcefPoint((*record)[xIdx].toDouble(),
476  (*record)[yIdx].toDouble(),
477  (*record)[zIdx].toDouble());
479  }
480  else
481  {
482  return false;
483  }
484  }
485  else
486  {
487  ossimNotify(ossimNotifyLevel_WARN) << "ossimApplanixEcefModel::loadState() Image id " << theImageID << " not found in eo file " << eo_file << std::endl;
488 
489  return false;
490  }
491  }
492  else
493  {
494  return false;
495  }
496  // computeGsdFlag = true;
497  }
498  else
499  {
500  if(roll)
501  {
502  theRoll = ossimString(roll).toDouble();
503  }
504  if(pitch)
505  {
506  thePitch = ossimString(pitch).toDouble();
507  }
508  if(heading)
509  {
510  theHeading = ossimString(heading).toDouble();
511  }
512  if(ecef_platform_position)
513  {
514  std::vector<ossimString> splitString;
515  ossimString tempString(ecef_platform_position);
516  tempString.split(splitString, ossimString(" "));
517  if(splitString.size() > 2)
518  {
519  theEcefPlatformPosition = ossimEcefPoint(splitString[0].toDouble(),
520  splitString[1].toDouble(),
521  splitString[2].toDouble());
522  }
523  }
524  else if(latlonh_platform_position)
525  {
526  std::vector<ossimString> splitString;
527  ossimString tempString(latlonh_platform_position);
528  tempString.split(splitString, ossimString(" "));
529  std::string datumString;
530  double lat=0.0, lon=0.0, h=0.0;
531  if(splitString.size() > 2)
532  {
533  lat = splitString[0].toDouble();
534  lon = splitString[1].toDouble();
535  h = splitString[2].toDouble();
536  }
537 
538  theEcefPlatformPosition = ossimGpt(lat,lon,h);
539  }
540  }
541 
542  if(camera_file)
543  {
544  ossimKeywordlist cameraKwl;
545  ossimKeywordlist lensKwl;
546  cameraKwl.add(camera_file);
547  const char* sensor = cameraKwl.find("sensor");
548  const char* image_size = cameraKwl.find(prefix, "image_size");
549  principal_point = cameraKwl.find("principal_point");
550  focal_length = cameraKwl.find("focal_length");
551  pixel_size = cameraKwl.find(prefix, "pixel_size");
552  focal_length = cameraKwl.find(prefix, "focal_length");
553  const char* distortion_units = cameraKwl.find(prefix, "distortion_units");
555  ossimUnitType unitType = OSSIM_MILLIMETERS;
556 
557  if(distortion_units)
558  {
559  unitType = (ossimUnitType)ossimUnitTypeLut::instance()->getEntryNumber(distortion_units);
560 
561  if(unitType == OSSIM_UNIT_UNKNOWN)
562  {
563  unitType = OSSIM_MILLIMETERS;
564  }
565  }
566  if(image_size)
567  {
568  std::vector<ossimString> splitString;
569  ossimString tempString(image_size);
570  tempString.split(splitString, ossimString(" "));
571  double w=1, h=1;
572  if(splitString.size() == 2)
573  {
574  w = splitString[0].toDouble();
575  h = splitString[1].toDouble();
576  }
577  theImageClipRect = ossimDrect(0,0,w-1,h-1);
578  theRefImgPt = ossimDpt(w/2.0, h/2.0);
579  theImageSize = ossimDpt(w,h);
580  }
581  if(sensor)
582  {
583  theSensorID = sensor;
584  }
585  if(principal_point)
586  {
587  std::vector<ossimString> splitString;
588  ossimString tempString(principal_point);
589  tempString.split(splitString, ossimString(" "));
590  if(splitString.size() == 2)
591  {
592  thePrincipalPoint.x = splitString[0].toDouble();
593  thePrincipalPoint.y = splitString[1].toDouble();
594  }
595  }
596  if(pixel_size)
597  {
598  std::vector<ossimString> splitString;
599  ossimString tempString(pixel_size);
600  tempString.split(splitString, ossimString(" "));
601  if(splitString.size() == 1)
602  {
603  thePixelSize.x = splitString[0].toDouble();
605  }
606  else if(splitString.size() == 2)
607  {
608  thePixelSize.x = splitString[0].toDouble();
609  thePixelSize.y = splitString[1].toDouble();
610  }
611  }
612  if(focal_length)
613  {
614  theFocalLength = ossimString(focal_length).toDouble();
615  }
616 
617  cameraKwl.trimAllValues();
618 
619 
620  ossimString regExpression = ossimString("^(") + "d[0-9]+)";
621  vector<ossimString> keys;
622  cameraKwl.getSubstringKeyList( keys, regExpression );
623  long numberOfDistortions = (long)keys.size();
624  int offset = (int)ossimString("d").size();
625  ossim_uint32 idx = 0;
626  std::vector<int> numberList(numberOfDistortions);
627  for(idx = 0; idx < numberList.size();++idx)
628  {
629  ossimString numberStr(keys[idx].begin() + offset,
630  keys[idx].end());
631  numberList[idx] = numberStr.toInt();
632  }
633  std::sort(numberList.begin(), numberList.end());
634  double distance=0.0, distortion=0.0;
635 
636  for(idx = 0; idx < numberList.size(); ++idx)
637  {
638  ossimString value = cameraKwl.find(ossimString("d")+ossimString::toString(numberList[idx]));
639 
640  if(!value.empty())
641  {
642  std::istringstream inStr(value.c_str());
643  inStr >> distance;
644  ossim::skipws(inStr);
645  inStr >> distortion;
646 #if 0
647  std::vector<ossimString> splitString;
648  ossimString tempString(value);
649  tempString = tempString.trim();
650  tempString.split(splitString, " ");
651  std::cout << splitString.size() << std::endl;
652  if(splitString.size() >= 2)
653  {
654  distance = splitString[0].toDouble();
655  distortion = splitString[1].toDouble();
656  }
657 #endif
658 
659  tool.setValue(distortion, unitType);
660  lensKwl.add(ossimString("distance") + ossimString::toString(idx),
661  distance,
662  true);
663  lensKwl.add(ossimString("distortion") + ossimString::toString(idx),
664  tool.getMillimeters(),
665  true);
666  }
667  lensKwl.add("convergence_threshold",
668  .00001,
669  true);
670  if(pixel_size)
671  {
672  lensKwl.add("dxdy",
673  ossimString(pixel_size) + " " + ossimString(pixel_size),
674  true);
675  }
676  else
677  {
678  lensKwl.add("dxdy",
679  ".009 .009",
680  true);
681  }
682  }
684  {
685  theLensDistortion->loadState(lensKwl,"");
686  }
687  }
688  else
689  {
690 
691  if(principal_point)
692  {
693  std::vector<ossimString> splitString;
694  ossimString tempString(principal_point);
695  tempString.split(splitString, ossimString(" "));
696  if(splitString.size() == 2)
697  {
698  thePrincipalPoint.x = splitString[0].toDouble();
699  thePrincipalPoint.y = splitString[1].toDouble();
700  }
701  }
702  else
703  {
704  if(traceDebug())
705  {
706  ossimNotify(ossimNotifyLevel_DEBUG) << "No principal_point found" << std::endl;
707  result = false;
708  }
709  }
710  if(pixel_size)
711  {
712  std::vector<ossimString> splitString;
713  ossimString tempString(pixel_size);
714  tempString.split(splitString, ossimString(" "));
715  if(splitString.size() == 1)
716  {
717  thePixelSize.x = splitString[0].toDouble();
719  }
720  else if(splitString.size() == 2)
721  {
722  thePixelSize.x = splitString[0].toDouble();
723  thePixelSize.y = splitString[1].toDouble();
724  }
725  }
726  else
727  {
728  if(traceDebug())
729  {
730  ossimNotify(ossimNotifyLevel_DEBUG) << "No pixel size found" << std::endl;
731  result = false;
732  }
733  }
734  if(focal_length)
735  {
736  theFocalLength = ossimString(focal_length).toDouble();
737  }
738  else
739  {
740  if(traceDebug())
741  {
742  ossimNotify(ossimNotifyLevel_DEBUG) << "No focal length found" << std::endl;
743  result = false;
744  }
745  }
746 
748  {
749  ossimString lensPrefix = ossimString(prefix)+"distortion.";
750  if(!theLensDistortion->loadState(kwl,
751  lensPrefix.c_str()))
752  {
753  result = false;
754  }
755  }
756  }
758  theRefGndPt.height(0.0);
759 
760  updateModel();
761 
762  if(compute_gsd_flag)
763  {
764  if(ossimString(compute_gsd_flag).toBool())
765  {
766  try
767  {
768  //---
769  // This will set theGSD and theMeanGSD. Method throws
770  // ossimException.
771  //---
772  computeGsd();
773  }
774  catch (const ossimException& e)
775  {
777  << "ossimApplanixEcefModel::loadState Caught Exception:\n"
778  << e.what() << std::endl;
779  }
780  }
781  }
782 
783  if(traceDebug())
784  {
785  ossimNotify(ossimNotifyLevel_DEBUG) << std::setprecision(15) << std::endl;
786  ossimNotify(ossimNotifyLevel_DEBUG) << "roll: " << theRoll << std::endl
787  << "pitch: " << thePitch << std::endl
788  << "heading: " << theHeading << std::endl
789  << "platform: " << theEcefPlatformPosition << std::endl
790  << "latlon Platform: " << ossimGpt(theEcefPlatformPosition) << std::endl
791  << "focal len: " << theFocalLength << std::endl
792  << "principal: " << thePrincipalPoint << std::endl
793  << "Ground: " << ossimGpt(theEcefPlatformPosition) << std::endl;
794  }
795 
796  return result;
797 }
ossimString theSensorID
ossimRefPtr< ossimMeanRadialLensDistortion > theLensDistortion
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
ossimUnitType
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
const char * find(const char *key) const
ossimString theImageID
void setValue(double value, ossimUnitType unitType=OSSIM_METERS)
double y
Definition: ossimDpt.h:165
static ossimString toString(bool aValue)
Numeric to string methods.
virtual ossim_int32 getEntryNumber(const char *entry_string, bool case_insensitive=true) const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimEcefPoint theAdjEcefPlatformPosition
void computeGsd()
This method computes the ground sample distance(gsd) and sets class attributes theGSD and theMeanGSD ...
OSSIM_DLL std::istream & skipws(std::istream &in)
Definition: ossimCommon.cpp:38
virtual const char * what() const
Returns the error message.
std::string::size_type size() const
Definition: ossimString.h:405
ossimEcefPoint theEcefPlatformPosition
unsigned int ossim_uint32
double height() const
Definition: ossimGpt.h:107
double toDouble() const
const ossimRefPtr< ossimApplanixEORecord > getRecordGivenId(const ossimString &id) const
Given an ID it will search and find an EO record that matches the ID.
std::vector< ossimString > getSubstringKeyList(const ossimString &regularExpression) const
ossimDrect theImageClipRect
ossim_int32 getFieldIdx(const ossimString &searchKey) const
Is a case insensitive parse of the column names for the orientation record.
double x
Definition: ossimDpt.h:164
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
bool empty() const
Definition: ossimString.h:411
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
bool parseFile(const ossimFilename &file)
Will parse the entire Exterior orientation file and then index any record ID&#39;s found.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
float distance(double lat1, double lon1, double lat2, double lon2, int units)
static ossimUnitTypeLut * instance()
Returns the static instance of an ossimUnitTypeLut object.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32
ossimKeywordlist & trimAllValues(const ossimString &valueToTrim=ossimString(" \\))

◆ saveState()

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

METHODS: saveState, loadState Fulfills ossimObject base-class pure virtuals. Loads and saves geometry KWL files.

Reimplemented from ossimSensorModel.

Definition at line 383 of file ossimApplanixEcefModel.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimMeanRadialLensDistortion::saveState(), ossimSensorModel::saveState(), theEcefPlatformPosition, theFocalLength, theHeading, theLensDistortion, thePitch, thePixelSize, thePrincipalPoint, theRoll, ossimString::toString(), ossimRefPtr< T >::valid(), ossimEcefPoint::x(), ossimDpt::x, ossimEcefPoint::y(), ossimDpt::y, and ossimEcefPoint::z().

385 {
386  ossimSensorModel::saveState(kwl, prefix);
387 
388  kwl.add(prefix, "type", "ossimApplanixEcefModel", true);
389 
390  kwl.add(prefix, "roll", theRoll, true);
391  kwl.add(prefix, "pitch", thePitch, true);
392  kwl.add(prefix, "heading", theHeading, true);
393  kwl.add(prefix, "principal_point", ossimString::toString(thePrincipalPoint.x) + " " + ossimString::toString(thePrincipalPoint.y));
394  kwl.add(prefix, "pixel_size", ossimString::toString(thePixelSize.x) + " " + ossimString::toString(thePixelSize.y));
395  kwl.add(prefix, "focal_length", theFocalLength);
396  kwl.add(prefix, "ecef_platform_position",
400 
402  {
403  ossimString lensPrefix = ossimString(prefix)+"distortion.";
405  lensPrefix.c_str());
406  }
407 
408  return true;
409 }
ossimRefPtr< ossimMeanRadialLensDistortion > theLensDistortion
bool valid() const
Definition: ossimRefPtr.h:75
double y
Definition: ossimDpt.h:165
static ossimString toString(bool aValue)
Numeric to string methods.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
double x() const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimEcefPoint theEcefPlatformPosition
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
double y() const
double x
Definition: ossimDpt.h:164
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 z() const

◆ setFocalLength()

void ossimApplanixEcefModel::setFocalLength ( double  focalLength)

Definition at line 370 of file ossimApplanixEcefModel.cpp.

References theFocalLength.

371 {
372  theFocalLength = focalLength;
373 }

◆ setImageRect()

void ossimApplanixEcefModel::setImageRect ( const ossimDrect rect)

Definition at line 364 of file ossimApplanixEcefModel.cpp.

References ossimDrect::midPoint(), ossimSensorModel::theImageClipRect, and ossimSensorModel::theRefImgPt.

365 {
366  theImageClipRect = rect;
367  theRefImgPt = rect.midPoint();
368 }
ossimDrect theImageClipRect
ossimDpt midPoint() const
Definition: ossimDrect.h:817

◆ setPixelSize()

void ossimApplanixEcefModel::setPixelSize ( const ossimDpt pixelSize)

Definition at line 359 of file ossimApplanixEcefModel.cpp.

References thePixelSize.

360 {
361  thePixelSize = pixelSize;
362 }

◆ setPlatformPosition()

void ossimApplanixEcefModel::setPlatformPosition ( const ossimGpt gpt)

Definition at line 375 of file ossimApplanixEcefModel.cpp.

References theEcefPlatformPosition, ossimSensorModel::theRefGndPt, and updateModel().

376 {
377  theRefGndPt = gpt;
379  updateModel();
380 
381 }
ossimEcefPoint theEcefPlatformPosition

◆ setPrincipalPoint()

void ossimApplanixEcefModel::setPrincipalPoint ( ossimDpt  principalPoint)

Definition at line 343 of file ossimApplanixEcefModel.cpp.

References thePrincipalPoint.

344 {
345  thePrincipalPoint = principalPoint;
346 }

◆ setRollPitchHeading()

void ossimApplanixEcefModel::setRollPitchHeading ( double  roll,
double  pitch,
double  heading 
)

Definition at line 348 of file ossimApplanixEcefModel.cpp.

References theHeading, thePitch, theRoll, and updateModel().

351 {
352  theRoll = roll;
353  thePitch = pitch;
354  theHeading = heading;
355 
356  updateModel();
357 }

◆ setupOptimizer()

bool ossimApplanixEcefModel::setupOptimizer ( const ossimString init_file)
virtual

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

Reimplemented from ossimOptimizableProjection.

Definition at line 799 of file ossimApplanixEcefModel.cpp.

References ossimKeywordlist::addFile(), ossimString::c_str(), and loadState().

800 {
801  ossimKeywordlist kwl;
802  kwl.addFile(init_file.c_str());
803 
804  return loadState(kwl);
805 }
Represents serializable keyword/value map.
bool addFile(const char *file)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
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

◆ updateModel()

void ossimApplanixEcefModel::updateModel ( )
virtual

VIRTUAL METHOD: updateModel() 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 265 of file ossimApplanixEcefModel.cpp.

References ossimAdjustableParameterInterface::computeParameterOffset(), ossimMatrix4x4::createRotationXMatrix(), ossimMatrix4x4::createRotationYMatrix(), ossimGpt::height(), ossimGpt::latd(), lineSampleToWorld(), ossimDrect::ll(), ossimGpt::lond(), ossimDrect::lr(), ossimLsrSpace::lsrToEcefRotMatrix(), ossimGpt::metersPerDegree(), OSSIM_LEFT_HANDED, ossimPolygon::resize(), theAdjEcefPlatformPosition, ossimSensorModel::theBoundGndPolygon, theCompositeMatrix, theCompositeMatrixInverse, theEcefPlatformPosition, ossimSensorModel::theExtrapolateGroundFlag, ossimSensorModel::theExtrapolateImageFlag, theHeading, ossimSensorModel::theImageClipRect, ossimSensorModel::theMeanGSD, thePitch, theRoll, ossimDrect::ul(), ossimDrect::ur(), and ossimDpt::x.

Referenced by ossimApplanixEcefModel(), setPlatformPosition(), and setRollPitchHeading().

266 {
267  ossimGpt gpt;
268  ossimGpt wgs84Pt;
269  double metersPerDegree = wgs84Pt.metersPerDegree().x;
270  double degreePerMeter = 1.0/metersPerDegree;
271  double latShift = -computeParameterOffset(1)*theMeanGSD*degreePerMeter;
272  double lonShift = computeParameterOffset(0)*theMeanGSD*degreePerMeter;
273 
275  double height = gpt.height();
276  gpt.height(height + computeParameterOffset(5));
277  gpt.latd(gpt.latd() + latShift);
278  gpt.lond(gpt.lond() + lonShift);
281 
282  // make a left handed roational matrix;
283  ossimMatrix4x4 lsrMatrix(lsrSpace.lsrToEcefRotMatrix());
286  theCompositeMatrix = (lsrMatrix.getData()*orientation);
288 
290  // ossim_float64 w = theImageClipRect.width()*2.0;
291  // ossim_float64 h = theImageClipRect.height()*2.0;
292  theExtrapolateImageFlag = false;
293  theExtrapolateGroundFlag = false;
294 
295  lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt);
296  theBoundGndPolygon[0] = gpt;
297  lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt);
298  theBoundGndPolygon[1] = gpt;
299  lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt);
300  theBoundGndPolygon[2] = gpt;
301  lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt);
302  theBoundGndPolygon[3] = gpt;
303 }
static NEWMAT::Matrix createRotationYMatrix(double angle, ossimCoordSysOrientMode orientationMode=OSSIM_RIGHT_HANDED)
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
const ossimDpt & ul() const
Definition: ossimDrect.h:339
NEWMAT::Matrix theCompositeMatrixInverse
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
NEWMAT::Matrix theCompositeMatrix
uses file path to init model
ossimEcefPoint theAdjEcefPlatformPosition
static NEWMAT::Matrix createRotationXMatrix(double angle, ossimCoordSysOrientMode orientationMode=OSSIM_RIGHT_HANDED)
ossimEcefPoint theEcefPlatformPosition
ossimPolygon theBoundGndPolygon
double height() const
Definition: ossimGpt.h:107
void lineSampleToWorld(const ossimDpt &image_point, ossimGpt &gpt) const
ossimDrect theImageClipRect
const ossimDpt & ur() const
Definition: ossimDrect.h:340
double x
Definition: ossimDpt.h:164
ossimDpt metersPerDegree() const
Definition: ossimGpt.cpp:498
const ossimDpt & ll() const
Definition: ossimDrect.h:342
void resize(ossim_uint32 newSize)
const ossimDpt & lr() const
Definition: ossimDrect.h:341
ossim_float64 theMeanGSD

◆ useForward()

virtual bool ossimApplanixEcefModel::useForward ( ) const
inlinevirtual

ossimOptimizableProjection

Implements ossimOptimizableProjection.

Definition at line 80 of file ossimApplanixEcefModel.h.

80 {return false;}

◆ worldToLineSample()

void ossimApplanixEcefModel::worldToLineSample ( const ossimGpt worldPoint,
ossimDpt lineSampPt 
) const
virtual

METHOD: worldToLineSample() Performs the forward projection from ground point to line, sample.

Reimplemented from ossimSensorModel.

Definition at line 225 of file ossimApplanixEcefModel.cpp.

References ossimEcefVector::data(), ossimLensDistortion::distort(), ossimPolygon::getNumberOfVertices(), ossimPolygon::hasNans(), ossimPolygon::pointWithin(), theAdjEcefPlatformPosition, ossimSensorModel::theBoundGndPolygon, theCompositeMatrixInverse, theFocalLength, theLensDistortion, thePixelSize, thePrincipalPoint, ossimSensorModel::theRefImgPt, ossimRefPtr< T >::valid(), ossimDpt::x, and ossimDpt::y.

227 {
228  #if 0
231  {
232  if (!(theBoundGndPolygon.pointWithin(world_point)))
233  {
234 // image_point.makeNan();
235 // image_point = extrapolate(world_point);
236 // return;
237  }
238  }
239  #endif
240  ossimEcefPoint g_ecf(world_point);
241  ossimEcefVector ecfRayDir(g_ecf - theAdjEcefPlatformPosition);
242  ossimColumnVector3d camRayDir (theCompositeMatrixInverse*ecfRayDir.data());
243 
244 
245  double scale = -theFocalLength/camRayDir[2];
246  ossimDpt film (scale*camRayDir[0], scale*camRayDir[1]);
247 
248  if (theLensDistortion.valid())
249  {
250  ossimDpt filmOut;
251  theLensDistortion->distort(film, filmOut);
252  film = filmOut;
253  }
254 
255  ossimDpt f1(film + thePrincipalPoint);
256  ossimDpt p1(f1.x/thePixelSize.x,
257  -f1.y/thePixelSize.y);
258 
259  ossimDpt p0 (p1.x + theRefImgPt.x,
260  p1.y + theRefImgPt.y);
261 
262  image_point = p0;
263 }
ossimRefPtr< ossimMeanRadialLensDistortion > theLensDistortion
bool valid() const
Definition: ossimRefPtr.h:75
double y
Definition: ossimDpt.h:165
NEWMAT::Matrix theCompositeMatrixInverse
ossimEcefPoint theAdjEcefPlatformPosition
ossimPolygon theBoundGndPolygon
bool hasNans() const
will sequence through the polygon and check to see if any values are NAN
bool pointWithin(const ossimDpt &point) const
METHOD: pointWithin(ossimDpt) Returns TRUE if point is inside polygon.
ossim_uint32 getNumberOfVertices() const
double x
Definition: ossimDpt.h:164
virtual void distort(const ossimDpt &input, ossimDpt &output) const

Member Data Documentation

◆ theAdjEcefPlatformPosition

ossimEcefPoint ossimApplanixEcefModel::theAdjEcefPlatformPosition
protected

◆ theCompositeMatrix

NEWMAT::Matrix ossimApplanixEcefModel::theCompositeMatrix
protected

uses file path to init model

Definition at line 85 of file ossimApplanixEcefModel.h.

Referenced by imagingRay(), ossimApplanixEcefModel(), and updateModel().

◆ theCompositeMatrixInverse

NEWMAT::Matrix ossimApplanixEcefModel::theCompositeMatrixInverse
protected

Definition at line 86 of file ossimApplanixEcefModel.h.

Referenced by ossimApplanixEcefModel(), updateModel(), and worldToLineSample().

◆ theEcefPlatformPosition

ossimEcefPoint ossimApplanixEcefModel::theEcefPlatformPosition
protected

◆ theFocalLength

double ossimApplanixEcefModel::theFocalLength
protected

◆ theHeading

double ossimApplanixEcefModel::theHeading
protected

◆ theLensDistortion

ossimRefPtr<ossimMeanRadialLensDistortion> ossimApplanixEcefModel::theLensDistortion
protected

◆ thePitch

double ossimApplanixEcefModel::thePitch
protected

◆ thePixelSize

ossimDpt ossimApplanixEcefModel::thePixelSize
protected

◆ thePrincipalPoint

ossimDpt ossimApplanixEcefModel::thePrincipalPoint
protected

◆ theRoll

double ossimApplanixEcefModel::theRoll
protected

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