OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimFcsiModel.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // DESCRIPTION: Contains sensor model class declaration for "Frame Camera
6 // Scanned Image" (FCSI, pronounced "foxy").
7 //
8 // This model represents image data that was scanned from film exposed by a
9 // conventional aerial frame camera. The data members defined in this class
10 // represent the fundamental quantities needed for the transformation.
11 // Typically, a different set of parameters will be provided in the metadata.
12 // An interface (support data) class will need to be implemented to convert
13 // a particular system's format to the quantities needed by this model.
14 //
15 // Coordinate systems in use are described here:
16 //
17 // Pixel -- line/sample in the digital image. The origin of this system is
18 // the upper left corner of the image, and represents a LEFT-
19 // HANDED coordinate system with Y (line) positive down and X
20 // (sample) positive to the right.
21 //
22 // Film -- x, y related to pixel space by affine transform (which includes
23 // mirror reflection due to left-handed system above) represented
24 // by thePrincipalPoint and the theScanXformMatrix. The latter
25 // contains scale, skew, and rotation/reflection. The film
26 // coordinates are adjusted for radial and decentering distortion.
27 //
28 // Camera/ -- 3D system containing film plane and optical (Z) axis. Given the
29 // Platform focal length (Z) and the film point (X,Y), a 3D ray direction
30 // is established in this space. This space is also termed "LSR"
31 // in the code. If there is a rotation between the film/optical
32 // axes and the platform (interior orientation), then that
33 // transformation must be included as part of the LSR-to-ECF
34 // rotation by the metadata reader object.
35 //
36 // ECF -- Universal earth frame of reference. The imaging ray direction
37 // is transformed from Camera space to ECF by theAdjLsrToEcfRot.
38 //
39 // There are two rotations to go from Camera to ECF. First is the initial
40 // camera orientation as derived from the metadata, combining the interior
41 // orientation (relation between camera and platform) and the exterior
42 // orientation dependent on the platform attitude w.r.t. the ECF system.
43 // The second rotation is a differential rotation due to the attitude
44 // adjustable params. These are arbitrarily taken as rotations about the ECF
45 // XYZ axes, not the platform attitude axes of roll/pitch/yaw. The
46 // combined rotation is stored in theAdjLsrToEcfRot, which is precomputed
47 // in updateModel() once with each adjustment.
48 //
49 // When the time comes to incorporate least-squares parameter adjustment, care
50 // must be taken to propagate the a priori sigmas for position and attitude
51 // (including both internal and external orientation angles) into the ECF
52 // coordinates. This also applies to the affine transform parameters used in
53 // transforming pixels to film coordinates. The propagated uncertainties can
54 // then be used to assign the adjustable parameter sigmas array (and
55 // covariance when we get to that...)
56 //
57 // SOFTWARE HISTORY:
58 // 16JAN2003 Oscar Kramer, ImageLinks
59 // Initial coding
60 //
61 //*****************************************************************************
62 // $Id: ossimFcsiModel.h 15766 2009-10-20 12:37:09Z gpotts $
63 
64 #ifndef ossimFcsiModel_HEADER
65 #define ossimFcsiModel_HEADER
66 
67 #include <iostream>
68 using namespace std;
69 
72 #include <ossim/base/ossimDpt.h>
76 
77 //******************************************************************************
78 //
79 // CLASS: ossimFcsiModel
80 //
81 //******************************************************************************
83 {
84 public:
89  ossimFcsiModel(const ossimFilename& init_file);
90  ossimFcsiModel(const ossimKeywordlist& geom_kwl);
91  ossimFcsiModel(const ossimFcsiModel& rhs);
92 
93 
95  {
96  X_POS = 0,
104  NUM_ADJUSTABLE_PARAMS // not an index
105  };
106 
110  virtual ossimObject* dup() const { return new ossimFcsiModel(*this); }
111 
115  virtual std::ostream& print(std::ostream& out) const;
116 
121  virtual bool saveState(ossimKeywordlist& kwl,
122  const char* prefix=0) const;
123 
124  virtual bool loadState(const ossimKeywordlist& kwl,
125  const char* prefix=0);
126 
131  static void writeGeomTemplate(ostream& os);
132 
136  virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
137  const double& heightEllipsoid,
138  ossimGpt& worldPoint) const;
139 
144  virtual void imagingRay(const ossimDpt& image_point,
145  ossimEcefRay& image_ray) const;
146 
151  virtual void worldToLineSample(const ossimGpt& world_point,
152  ossimDpt& image_point) const;
153 
159  virtual void updateModel();
160 
164  static const char* PRINCIPAL_POINT_X_KW;
165  static const char* PRINCIPAL_POINT_Y_KW;
166  static const char* SCAN_SCALE_MATRIX_00_KW;
167  static const char* SCAN_SCALE_MATRIX_01_KW;
168  static const char* SCAN_SCALE_MATRIX_10_KW;
169  static const char* SCAN_SCALE_MATRIX_11_KW;
170  static const char* SCAN_SKEW_ANGLE_KW;
171  static const char* SCAN_ROTATION_ANGLE_KW;
172  static const char* FOCAL_LENGTH_KW;
173  static const char* PLATFORM_POSITION_X_KW;
174  static const char* PLATFORM_POSITION_Y_KW;
175  static const char* PLATFORM_POSITION_Z_KW;
177 
181  inline virtual bool useForward()const {return true;}
182 
183 protected:
184  virtual ~ossimFcsiModel() { delete theOpticalDistortion; }
185 
190  void initAdjustableParameters();
191 
192  //***
193  // Affine transform variables for scanned image to film coordinate
194  // transformation, in order of application:
195  //***
196  ossimDpt thePrincipalPoint; // principal point location in pixels
197  double theScanScaleMatrix[4];// converts pixel to film X, Y mm
198  double theScanSkew; // degrees
199  double theScanRotation; // degrees left rotation of scanned image
200 
201  //***
202  // Transform variables for film coordinates to platform LSR (interior
203  // orientation):
204  //***
205  double theFocalLen; // millimeters
207 
208  //***
209  // Transform variables for platform LSR to ECF coordinates (interior/exterior
210  // orientation and offset):
211  //***
213  NEWMAT::Matrix theLsrToEcfRot;
214 
215  //***
216  // Un-normalized adjustable parameters:
217  //***
219  double theXrotCorr; // degrees
220  double theYrotCorr; // degrees
221  double theZrotCorr; // degrees
222  double theFocalOffset; // millimeters
223  double theScanSkewCorr; // degrees
224 
225  //***
226  // Quantities derived from adjustables and assigned in updateModel():
227  //***
230  NEWMAT::Matrix theAdjLsrToEcfRot;
231  NEWMAT::Matrix theAdjEcfToLsrRot;
232  double theScanXformMatrix[4];
233  double theInvScanXformMatrix[4];
234 
235  TYPE_DATA
236 };
237 
238 #endif
static const char * FOCAL_LENGTH_KW
static const char * PLATFORM_POSITION_Y_KW
double theScanSkewCorr
Represents serializable keyword/value map.
ossimEcefVector theEcfOffset
static const char * PRINCIPAL_POINT_X_KW
NEWMAT::Matrix theAdjEcfToLsrRot
NEWMAT::Matrix theLsrToEcfRot
static const char * PRINCIPAL_POINT_Y_KW
ossimRadialDecentLensDistortion * theOpticalDistortion
std::ostream & print(H5::H5File *file, std::ostream &out)
Print method.
Definition: ossimH5Util.cpp:41
static const char * SCAN_ROTATION_ANGLE_KW
static const char * PLATFORM_POSITION_Z_KW
ossimEcefPoint theAdjPlatformPos
#define TYPE_DATA
Definition: ossimRtti.h:339
static const char * CAMERA_ORIENTATION_MATRIX_ELEM_KW
static const char * SCAN_SCALE_MATRIX_11_KW
static const char * PLATFORM_POSITION_X_KW
virtual bool useForward() const
static const char * SCAN_SCALE_MATRIX_00_KW
virtual ossimObject * dup() const
NEWMAT::Matrix theAdjLsrToEcfRot
#define OSSIM_DLL
ossimEcefPoint thePlatformPos
double theScanRotation
virtual ~ossimFcsiModel()
ground to image faster (you don&#39;t need DEM)
ossimDpt thePrincipalPoint
static const char * SCAN_SKEW_ANGLE_KW
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
static const char * SCAN_SCALE_MATRIX_01_KW
static const char * SCAN_SCALE_MATRIX_10_KW