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

#include <ossimSkyBoxLearSensor.h>

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

Public Member Functions

 ossimSkyBoxLearSensor ()
 
 ossimSkyBoxLearSensor (const ossimSkyBoxLearSensor &src)
 
virtual ossimObjectdup () const
 
virtual void imagingRay (const ossimDpt &image_point, ossimEcefRay &image_ray) const
 
virtual void lineSampeToWorld (const ossimDpt &image_point, ossimGpt &worldPoint) const
 
virtual void lineSampleHeightToWorld (const ossimDpt &image_point, const double &heightEllipsoid, ossimGpt &worldPoint) const
 
virtual void updateModel ()
 
void setRollPitchYaw (double r, double p, double y)
 
void setFocalLength (double value)
 
void setPlatformPosition (const ossimGpt &value)
 
void setPrincipalPoint (const ossimDpt &value)
 
void setPixelSize (const ossimDpt &value)
 
virtual bool useForward () const
 
virtual void initAdjustableParameters ()
 ground to image faster (you don't need DEM) //TBC More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) 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
 
virtual void worldToLineSample (const ossimGpt &world_point, ossimDpt &image_point) const
 
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 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...
 

Protected Attributes

NEWMAT::Matrix m_air2Ned
 
NEWMAT::Matrix m_ecef2Ned
 
NEWMAT::Matrix m_ecef2NedInverse
 
double m_roll
 
double m_pitch
 
double m_yaw
 
ossimDpt m_principalPoint
 
ossimDpt m_pixelSize
 
double m_focalLength
 
ossimEcefPoint m_ecefPlatformPosition
 
ossimGpt m_platformPosition
 
ossimGpt m_platformPositionEllipsoid
 
double m_fovIntrack
 
double m_fovCrossTrack
 
ossimGpt m_adjustedPlatformPosition
 
- 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 17 of file ossimSkyBoxLearSensor.h.

Constructor & Destructor Documentation

◆ ossimSkyBoxLearSensor() [1/2]

ossimSkyBoxLearSensor::ossimSkyBoxLearSensor ( )

Definition at line 42 of file ossimSkyBoxLearSensor.cpp.

References initAdjustableParameters(), and ossimSensorModel::theSensorID.

43 {
45  theSensorID = "SkyBoxLear";
46 }
ossimString theSensorID
virtual void initAdjustableParameters()
ground to image faster (you don&#39;t need DEM) //TBC

◆ ossimSkyBoxLearSensor() [2/2]

ossimSkyBoxLearSensor::ossimSkyBoxLearSensor ( const ossimSkyBoxLearSensor src)
inline

Definition at line 21 of file ossimSkyBoxLearSensor.h.

22  :ossimSensorModel(src),
23  m_air2Ned(src.m_air2Ned),
26  m_roll(src.m_roll),
27  m_pitch(src.m_pitch),
28  m_yaw(src.m_yaw),
29  m_principalPoint(src.m_principalPoint), // in meters
30  m_pixelSize(src.m_pixelSize), // in meters
31  m_focalLength(src.m_focalLength), // in meters
38  {
39  }
ossimEcefPoint m_ecefPlatformPosition
NEWMAT::Matrix m_ecef2NedInverse

Member Function Documentation

◆ dup()

virtual ossimObject* ossimSkyBoxLearSensor::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 40 of file ossimSkyBoxLearSensor.h.

41  {
42  return new ossimSkyBoxLearSensor(*this);
43  }

◆ imagingRay()

void ossimSkyBoxLearSensor::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 48 of file ossimSkyBoxLearSensor.cpp.

References ossimAdjustableParameterInterface::computeParameterOffset(), m_adjustedPlatformPosition, m_air2Ned, m_ecef2NedInverse, m_focalLength, m_pixelSize, m_principalPoint, PARAM_ADJ_FOCAL_LENGTH_OFFSET, ossimEcefRay::setDirection(), ossimEcefRay::setOrigin(), ossimSensorModel::theRefImgPt, ossimDpt::x, and ossimDpt::y.

Referenced by lineSampeToWorld(), and lineSampleHeightToWorld().

50 {
51  ossimDpt f1 (image_point - theRefImgPt);
52  f1.x *= m_pixelSize.x;
53  f1.y *= -m_pixelSize.y;
54  ossimDpt film (f1 - m_principalPoint);
55 
56  // once we have them we can add distortion fixes
57  // here on the film
58  //
59 
60 
61  // now orient the local film point to the ECEF axes
62  // in a north east down lsr space.
63  //
67  ossimEcefVector ecf_ray_dir (rc_ecef);
68  image_ray.setDirection(ecf_ray_dir);
69 
70 }
double y
Definition: ossimDpt.h:165
void setOrigin(const ossimEcefPoint &orig)
Definition: ossimEcefRay.h:81
NEWMAT::Matrix m_ecef2NedInverse
double x
Definition: ossimDpt.h:164
void setDirection(const ossimEcefVector &d)
Definition: ossimEcefRay.h:82

◆ initAdjustableParameters()

void ossimSkyBoxLearSensor::initAdjustableParameters ( )
virtual

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

Reimplemented from ossimAdjustableParameterInterface.

Definition at line 153 of file ossimSkyBoxLearSensor.cpp.

References PARAM_ADJ_ALTITUDE_OFFSET, PARAM_ADJ_COUNT, PARAM_ADJ_FOCAL_LENGTH_OFFSET, PARAM_ADJ_LAT_OFFSET, PARAM_ADJ_LON_OFFSET, PARAM_ADJ_PITCH_OFFSET, PARAM_ADJ_ROLL_OFFSET, PARAM_ADJ_YAW_OFFSET, ossimAdjustableParameterInterface::resizeAdjustableParameterArray(), ossimAdjustableParameterInterface::setAdjustableParameter(), ossimAdjustableParameterInterface::setParameterDescription(), ossimAdjustableParameterInterface::setParameterSigma(), and ossimAdjustableParameterInterface::setParameterUnit().

Referenced by loadState(), and ossimSkyBoxLearSensor().

154 {
156 
161 
166 
171 
176 
181 
186 
191 }
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)

◆ lineSampeToWorld()

void ossimSkyBoxLearSensor::lineSampeToWorld ( const ossimDpt image_point,
ossimGpt worldPoint 
) const
virtual

Definition at line 72 of file ossimSkyBoxLearSensor.cpp.

References imagingRay(), ossimElevManager::instance(), and ossimElevSource::intersectRay().

74 {
75  ossimEcefRay ray;
76  imagingRay(image_point, ray);
77  ossimElevManager::instance()->intersectRay(ray, worldPoint);
78 
79 }
virtual void imagingRay(const ossimDpt &image_point, ossimEcefRay &image_ray) const
bool intersectRay(const ossimEcefRay &ray, ossimGpt &gpt, double defaultElevValue=0.0)
METHOD: intersectRay()
static ossimElevManager * instance()
METHOD: instance() Implements singelton pattern.

◆ lineSampleHeightToWorld()

void ossimSkyBoxLearSensor::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 81 of file ossimSkyBoxLearSensor.cpp.

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

84 {
85  //***
86  // First establish imaging ray from image point:
87  //***
88  ossimEcefRay ray;
89  imagingRay(lineSampPt, ray);
90  ossimEcefPoint Pecf (ray.intersectAboveEarthEllipsoid(heightEllipsoid));
91  worldPt = ossimGpt(Pecf);
92 }
virtual void imagingRay(const ossimDpt &image_point, ossimEcefRay &image_ray) const
ossimEcefPoint intersectAboveEarthEllipsoid(const double &heightAboveEllipsoid, const ossimDatum *aDatum=ossimDatumFactory::instance() ->wgs84()) const

◆ loadState()

bool ossimSkyBoxLearSensor::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 193 of file ossimSkyBoxLearSensor.cpp.

References ossimSensorModel::computeGsd(), ossimString::empty(), ossimKeywordlist::find(), ossimAdjustableParameterInterface::getNumberOfAdjustableParameters(), ossimDpt::hasNans(), ossimDrect::hasNans(), ossimGpt::height(), initAdjustableParameters(), ossimGeoidManager::instance(), ossimDpt::isNan(), ossim::isnan(), ossimSensorModel::loadState(), m_focalLength, m_pitch, m_pixelSize, m_platformPosition, m_platformPositionEllipsoid, m_principalPoint, m_roll, m_yaw, ossimDpt::makeNan(), ossimDrect::midPoint(), ossimGeoidManager::offsetFromEllipsoid(), ossimSensorModel::theGSD, ossimSensorModel::theImageClipRect, ossimSensorModel::theImageSize, ossimSensorModel::theRefImgPt, ossimString::toDouble(), ossimIpt::toPoint(), ossimDpt::toPoint(), ossimGpt::toPoint(), updateModel(), ossimIpt::x, and ossimIpt::y.

194 {
195  theGSD.makeNan();
197  ossimSensorModel::loadState(kwl, prefix);
199  {
201  }
202  ossimString image_size = kwl.find(prefix, "image_size");
203  ossimString pixel_size = kwl.find(prefix, "pixel_size");
204  ossimString principal_point = kwl.find(prefix, "principal_point");
205  ossimString focal_length = kwl.find(prefix, "focal_length");
206  ossimString roll;
207  ossimString pitch;
208  ossimString yaw;
209  ossimString platform_position;
210  m_roll = 0;
211  m_pitch = 0;
212  m_yaw = 0;
213  roll = kwl.find(prefix, "roll");
214  pitch = kwl.find(prefix, "pitch");
215  yaw = kwl.find(prefix, "yaw");
216  platform_position = kwl.find(prefix, "platform_position");
217  bool result = (!pixel_size.empty()&&
218  !principal_point.empty()&&
219  !focal_length.empty()&&
220  !platform_position.empty());
221  if(!image_size.empty())
222  {
223  theImageSize.toPoint(image_size);
226  }
228  {
230  }
231  if(theRefImgPt.hasNans())
232  {
234  }
235  if(!focal_length.empty())
236  {
237  m_focalLength = focal_length.toDouble();
238  }
239  if(!pixel_size.empty())
240  {
241  m_pixelSize.toPoint(pixel_size);
242  }
243  if(!roll.empty())
244  {
245  m_roll = roll.toDouble();
246  }
247  if(!pitch.empty())
248  {
249  m_pitch = pitch.toDouble();
250  }
251  if(!yaw.empty())
252  {
253  m_yaw = yaw.toDouble();
254  }
255  if(!principal_point.empty())
256  {
257  m_principalPoint.toPoint(principal_point);
258  }
259  if(!platform_position.empty())
260  {
261  m_platformPosition.toPoint(platform_position);
264  if(!ossim::isnan(offset))
265  {
267  }
268  }
269  updateModel();
270 
271  if(theGSD.isNan())
272  {
273  try
274  {
275  // This will set theGSD and theMeanGSD. Method throws ossimException.
276  computeGsd();
277  }
278  catch (const ossimException& e)
279  {
280  if (traceDebug())
281  {
283  << "ossimSkyBoxLearSensor::loadState Caught Exception:\n"
284  << e.what() << std::endl;
285  }
286  }
287  }
288 
289  return result;
290 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
const char * find(const char *key) const
bool isNan() const
Definition: ossimDpt.h:72
void computeGsd()
This method computes the ground sample distance(gsd) and sets class attributes theGSD and theMeanGSD ...
void toPoint(const std::string &s)
Initializes this point from string.
Definition: ossimGpt.cpp:116
virtual const char * what() const
Returns the error message.
void toPoint(const std::string &s)
Initializes this point from string.
Definition: ossimDpt.cpp:192
static ossimGeoidManager * instance()
Implements singelton pattern:
double height() const
Definition: ossimGpt.h:107
double toDouble() const
bool hasNans() const
Definition: ossimDrect.h:396
bool hasNans() const
Definition: ossimDpt.h:67
void toPoint(const std::string &s)
Initializes this point from string.
Definition: ossimIpt.cpp:170
ossimDrect theImageClipRect
ossimDpt midPoint() const
Definition: ossimDrect.h:817
ossim_int32 y
Definition: ossimIpt.h:142
virtual void initAdjustableParameters()
ground to image faster (you don&#39;t need DEM) //TBC
bool empty() const
Definition: ossimString.h:411
ossim_int32 x
Definition: ossimIpt.h:141
virtual double offsetFromEllipsoid(const ossimGpt &gpt)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void makeNan()
Definition: ossimDpt.h:65
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ saveState()

bool ossimSkyBoxLearSensor::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 292 of file ossimSkyBoxLearSensor.cpp.

References ossimKeywordlist::add(), m_focalLength, m_pitch, m_pixelSize, m_platformPosition, m_principalPoint, m_roll, m_yaw, ossimSensorModel::saveState(), ossimSensorModel::theImageSize, ossimIpt::toString(), ossimDpt::toString(), ossimGpt::toString(), and ossimString::toString().

293 {
294  ossimSensorModel::saveState(kwl, prefix);
295  kwl.add(prefix, "roll", ossimString::toString(m_roll), true);
296  kwl.add(prefix, "pitch", ossimString::toString(m_pitch), true);
297  kwl.add(prefix, "yaw", ossimString::toString(m_yaw), true);
298  kwl.add(prefix, "principal_point", m_principalPoint.toString(), true);
299  kwl.add(prefix, "pixel_size", m_pixelSize.toString(), true);
300  kwl.add(prefix, "platform_position",m_platformPosition.toString() ,true);
301  kwl.add(prefix, "focal_length", ossimString::toString(m_focalLength) ,true);
302  kwl.add(prefix, "image_size", theImageSize.toString() ,true);
303 
304  return true;
305 }
ossimString toString() const
Definition: ossimIpt.cpp:139
static ossimString toString(bool aValue)
Numeric to string methods.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimDpt.cpp:160
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimGpt.cpp:78

◆ setFocalLength()

void ossimSkyBoxLearSensor::setFocalLength ( double  value)
inline

Definition at line 64 of file ossimSkyBoxLearSensor.h.

65  {
66  m_focalLength = value;
67  }

◆ setPixelSize()

void ossimSkyBoxLearSensor::setPixelSize ( const ossimDpt value)
inline

Definition at line 78 of file ossimSkyBoxLearSensor.h.

79  {
80  m_pixelSize = value;
81  }

◆ setPlatformPosition()

void ossimSkyBoxLearSensor::setPlatformPosition ( const ossimGpt value)
inline

Definition at line 68 of file ossimSkyBoxLearSensor.h.

69  {
70  m_platformPosition = value;
71  m_ecefPlatformPosition = value;
72  }
ossimEcefPoint m_ecefPlatformPosition

◆ setPrincipalPoint()

void ossimSkyBoxLearSensor::setPrincipalPoint ( const ossimDpt value)
inline

Definition at line 74 of file ossimSkyBoxLearSensor.h.

75  {
76  m_principalPoint = value;
77  }

◆ setRollPitchYaw()

void ossimSkyBoxLearSensor::setRollPitchYaw ( double  r,
double  p,
double  y 
)
inline

Definition at line 58 of file ossimSkyBoxLearSensor.h.

References y.

59  {
60  m_roll = r;
61  m_pitch = p;
62  m_yaw = y;
63  }
ossim_uint32 y

◆ updateModel()

void ossimSkyBoxLearSensor::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 94 of file ossimSkyBoxLearSensor.cpp.

References ossimSensorModel::computeGsd(), ossimAdjustableParameterInterface::computeParameterOffset(), ossim::cosd(), ossimMatrix3x3::create(), ossim::degreesToRadians(), ossimGpt::height(), ossimDrect::height(), ossimGpt::latd(), ossimSensorModel::lineSampleToWorld(), ossimDrect::ll(), ossimGpt::lond(), ossimDrect::lr(), m_adjustedPlatformPosition, m_air2Ned, m_ecef2Ned, m_ecef2NedInverse, m_focalLength, m_fovCrossTrack, m_fovIntrack, m_pitch, m_platformPositionEllipsoid, m_roll, m_yaw, PARAM_ADJ_ALTITUDE_OFFSET, PARAM_ADJ_FOCAL_LENGTH_OFFSET, PARAM_ADJ_LAT_OFFSET, PARAM_ADJ_LON_OFFSET, PARAM_ADJ_PITCH_OFFSET, PARAM_ADJ_ROLL_OFFSET, PARAM_ADJ_YAW_OFFSET, ossimPolygon::resize(), ossim::sind(), ossimSensorModel::theBoundGndPolygon, ossimSensorModel::theImageClipRect, ossimSensorModel::theImageSize, ossimSensorModel::theRefGndPt, ossimSensorModel::theRefImgPt, ossimDrect::ul(), ossimDrect::ur(), ossimDrect::width(), ossimIpt::x, ossimDpt::x, ossimIpt::y, ossimDpt::y, and y.

Referenced by loadState().

95 {
99 
103  NEWMAT::Matrix rollM = ossimMatrix3x3::create(1, 0, 0,
104  0, cos(r), sin(r),
105  0, -sin(r), cos(r));
106  NEWMAT::Matrix pitchM = ossimMatrix3x3::create(cos(p), 0, -sin(p),
107  0, 1, 0,
108  sin(p), 0, cos(p));
109  NEWMAT::Matrix yawM = ossimMatrix3x3::create(cos(y), sin(y), 0,
110  -sin(y), cos(y), 0,
111  0,0,1);
112  m_air2Ned = rollM*pitchM*yawM;
113 
114  double sin_lat = ossim::sind(m_adjustedPlatformPosition.latd());
115  double cos_lat = ossim::cosd(m_adjustedPlatformPosition.latd());
116  double sin_lon = ossim::sind(m_adjustedPlatformPosition.lond());
117  double cos_lon = ossim::cosd(m_adjustedPlatformPosition.lond());
118  m_ecef2Ned = (ossimMatrix3x3::create(0,0,1,0,1,0,-1,0,0)*
119  ossimMatrix3x3::create(cos_lat, 0, sin_lat, 0,1,0, -sin_lat,0,cos_lat)*
120  ossimMatrix3x3::create(cos_lon,sin_lon,0, -sin_lon, cos_lon, 0, 0, 0, 1));
123  m_fovIntrack = (atan((theImageSize.y*theRefImgPt.y)/adjustedFocal));
124  m_fovCrossTrack = (atan((theImageSize.x*theRefImgPt.x)/adjustedFocal));
125 
126 
128 
132  ossimGpt gpt;
133 
135  theBoundGndPolygon[0] = gpt;
137  theBoundGndPolygon[1] = gpt;
139  theBoundGndPolygon[2] = gpt;
141  theBoundGndPolygon[3] = gpt;
142 
143  try
144  {
145  computeGsd();
146  }
147  catch(...)
148  {
149 
150  }
151 }
ossim_float64 width() const
Definition: ossimDrect.h:522
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
ossim_uint32 y
const ossimDpt & ul() const
Definition: ossimDrect.h:339
double y
Definition: ossimDpt.h:165
double sind(double x)
Definition: ossimCommon.h:260
virtual void lineSampleToWorld(const ossimDpt &image_point, ossimGpt &world_point) const
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
double ossim_float64
void computeGsd()
This method computes the ground sample distance(gsd) and sets class attributes theGSD and theMeanGSD ...
double degreesToRadians(double x)
Definition: ossimCommon.h:258
ossimPolygon theBoundGndPolygon
double height() const
Definition: ossimGpt.h:107
static NEWMAT::Matrix create()
double cosd(double x)
Definition: ossimCommon.h:259
ossim_float64 height() const
Definition: ossimDrect.h:517
ossimDrect theImageClipRect
ossim_int32 y
Definition: ossimIpt.h:142
NEWMAT::Matrix m_ecef2NedInverse
const ossimDpt & ur() const
Definition: ossimDrect.h:340
double x
Definition: ossimDpt.h:164
ossim_int32 x
Definition: ossimIpt.h:141
const ossimDpt & ll() const
Definition: ossimDrect.h:342
void resize(ossim_uint32 newSize)
const ossimDpt & lr() const
Definition: ossimDrect.h:341

◆ useForward()

virtual bool ossimSkyBoxLearSensor::useForward ( ) const
inlinevirtual

useForward() return true when it's better (more accurate / fast) to use forward (from ground to image) than inverse(from image to ground)

Implements ossimOptimizableProjection.

Definition at line 82 of file ossimSkyBoxLearSensor.h.

82 {return true;}

Member Data Documentation

◆ m_adjustedPlatformPosition

ossimGpt ossimSkyBoxLearSensor::m_adjustedPlatformPosition
protected

Definition at line 104 of file ossimSkyBoxLearSensor.h.

Referenced by imagingRay(), and updateModel().

◆ m_air2Ned

NEWMAT::Matrix ossimSkyBoxLearSensor::m_air2Ned
protected

Definition at line 89 of file ossimSkyBoxLearSensor.h.

Referenced by imagingRay(), and updateModel().

◆ m_ecef2Ned

NEWMAT::Matrix ossimSkyBoxLearSensor::m_ecef2Ned
protected

Definition at line 90 of file ossimSkyBoxLearSensor.h.

Referenced by updateModel().

◆ m_ecef2NedInverse

NEWMAT::Matrix ossimSkyBoxLearSensor::m_ecef2NedInverse
protected

Definition at line 91 of file ossimSkyBoxLearSensor.h.

Referenced by imagingRay(), and updateModel().

◆ m_ecefPlatformPosition

ossimEcefPoint ossimSkyBoxLearSensor::m_ecefPlatformPosition
protected

Definition at line 98 of file ossimSkyBoxLearSensor.h.

◆ m_focalLength

double ossimSkyBoxLearSensor::m_focalLength
protected

Definition at line 97 of file ossimSkyBoxLearSensor.h.

Referenced by imagingRay(), loadState(), saveState(), and updateModel().

◆ m_fovCrossTrack

double ossimSkyBoxLearSensor::m_fovCrossTrack
protected

Definition at line 102 of file ossimSkyBoxLearSensor.h.

Referenced by updateModel().

◆ m_fovIntrack

double ossimSkyBoxLearSensor::m_fovIntrack
protected

Definition at line 101 of file ossimSkyBoxLearSensor.h.

Referenced by updateModel().

◆ m_pitch

double ossimSkyBoxLearSensor::m_pitch
protected

Definition at line 93 of file ossimSkyBoxLearSensor.h.

Referenced by loadState(), saveState(), and updateModel().

◆ m_pixelSize

ossimDpt ossimSkyBoxLearSensor::m_pixelSize
protected

Definition at line 96 of file ossimSkyBoxLearSensor.h.

Referenced by imagingRay(), loadState(), and saveState().

◆ m_platformPosition

ossimGpt ossimSkyBoxLearSensor::m_platformPosition
protected

Definition at line 99 of file ossimSkyBoxLearSensor.h.

Referenced by loadState(), and saveState().

◆ m_platformPositionEllipsoid

ossimGpt ossimSkyBoxLearSensor::m_platformPositionEllipsoid
protected

Definition at line 100 of file ossimSkyBoxLearSensor.h.

Referenced by loadState(), and updateModel().

◆ m_principalPoint

ossimDpt ossimSkyBoxLearSensor::m_principalPoint
protected

Definition at line 95 of file ossimSkyBoxLearSensor.h.

Referenced by imagingRay(), loadState(), and saveState().

◆ m_roll

double ossimSkyBoxLearSensor::m_roll
protected

Definition at line 92 of file ossimSkyBoxLearSensor.h.

Referenced by loadState(), saveState(), and updateModel().

◆ m_yaw

double ossimSkyBoxLearSensor::m_yaw
protected

Definition at line 94 of file ossimSkyBoxLearSensor.h.

Referenced by loadState(), saveState(), and updateModel().


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