Commit d4a9aced authored by Tyler Wilson's avatar Tyler Wilson
Browse files

Corrected the oblique resolution formula in the Camera class. Fixes #4614

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@7430 41f8697f-d340-4b68-9986-7bafba869bb8
parent 418ebbef
Loading
Loading
Loading
Loading
+16 −74
Original line number Diff line number Diff line
@@ -568,74 +568,28 @@ namespace Isis {


  /**
   * @description This function provides an improved estimate of the detector resolution (in meters)
   * when the target is near the limb.  It does this by calculating the determinant of an affine
   * transformation. The area element of one pixel projected onto the surface at Nadir looks
   * like a square with sides of length = Detector Resolution.  The detector resolution is the
   * value returned by the original function.  An affine projective transformation of this
   * area element as one would see if it was on the limb instead of looking straight down, appears
   * like a skewed parallelogram.
   * @description This method returns the Oblique Detector Resolution
   * if the Look Vector intersects the target and if the emission angle is greater than or equal
   * to 0, and less than 90 degrees.   Otherwise, it returns -1.0.  This formula provides an
   * improved estimate to the detector resolution for images near the limb:
   *
   * The determinant of the transformation matrix taking the Nadir-area element into
   * some parallelogram near the limb of a planet measures the change in area for the
   * transformation when we are off-Nadir.  The sqare-root of the area of this parallelogram
   * gives us the resolution.
   *
   *The calculation is straightforward.  Any affine transformation with a strictly positive
   *determinant that is not a similarity transformation has a unique decomposition
   *(See Theorem 2.1 in Reference #1):
   * @f[ \text{Oblique\;\;Detector\;\; Resolution} = \frac{n}{cos(\theta)} @f]
   *
   *
   * The equation is derived two separate ways.  A geometric argument is presented in
   * Reference 2, while a matrix algebra based argument is presented in Theorem 2.1 of
   * Reference 1.
   *
   *
   * @f{eqnarray*}
   *
   *        A = \[\left[\begin{array}{cc} a & b \\
   *                                      c & d \end{array} \right]\] =
   *
   *         H_{\lambda}R_1(\psi)T_tR_2(\phi) = \lambda
   *        \[ \left[\begin{array}{cc} cos(\psi) & -sin(\psi) \\
   *                                   sin(\psi) & cos(\psi) \end{array} \right]\]
   *        \[ \left[\begin{array}{cc} t & 0 \\
   *                                   0 & 1 \end{array} \right]\]
   *        \[ \left[\begin{array}{cc} cos(\phi) & -sin(\phi) \\
   *                                   sin(\phi) & cos(\phi) \end{array} \right]\]
   *
   * @f}
   *
   * Where:
   *
   * @f$ t = \frac{1}{cos(\theta)}},\;\;\theta = \text{Emmission\;\; Angle}@f$
   * and @f$\lambda = \text{zoom\;\;factor} = 1@f$
   *
   *  The determinant of A is:
   *
   *  @f[ |A| = \lambda t = \frac{\lambda}{cos(\theta)} = \frac{1}{\cos(\theta)} @f]
   *
   * This is because the two rotation matrices in this decomposition have determinants equal to 1.
   *
   *  Let @f$ n = \text{Detector\;\;Resolution} @f$
   *
   *  Then:
   *
   *   @f[ Area = n^2 |A| =\frac{n^2}{cos(\theta)}@f]
   *
   * And:
   *
   *   @f[ \text{Local\;\;Detector\;\; Resolution} = \frac{n}{\sqrt{cos(\theta)}} @f]
   *
   *
   * This method returns the Local Detector Resolution if the Look Vector intersects the target
   * and if @f$ 0 \leq \theta < \frac{\pi}{2} @f$ and -1.0 otherwise.
   *
   *
   *
   *
   *   Reference 1:  J-M Morel and G. Yu, "Asift:  A new framework for fully affine
   *   <b>Reference 1:</b>  J-M Morel and G. Yu, "Asift:  A new framework for fully affine
   *                 invariant image comparison," SIAM Journal on Imaging Sciences
   *                 2(2), pp. 438-469, 2009
   *
   *
   *   <b>Reference 2:</b>  Handwritten notes by Orrin Thomas which can be found in the
   *                 Glossary under the entry for Oblique Detector Resolution.
   *
   * @return @b double
   */
  double Camera::ObliqueDetectorResolution(){
@@ -643,23 +597,11 @@ namespace Isis {

      if(HasSurfaceIntersection()){


          double thetaRad;          
          double sB[3];
          instrumentPosition(sB);
          double pB[3];
          Coordinate(pB);
          double a = sB[0] - pB[0];
          double b = sB[1] - pB[1];
          double c = sB[2] - pB[2];
          double rho = sqrt(a * a + b * b + c * c) * 1000.0;

          thetaRad = EmissionAngle()*DEG2RAD;

          if (thetaRad < HALFPI) {           

            double nadirResolution = rho/(p_focalLength/p_pixelPitch);
            return nadirResolution/sqrt(cos(thetaRad));
            return DetectorResolution()/cos(thetaRad);

          }
          return Isis::Null;
+4 −4
Original line number Diff line number Diff line
@@ -84,13 +84,13 @@ GroundRange: 0
IntersectsLongitudeDomain: 0
PixelResolution: 628
ExposureDuration: 0.4
ObliquePixelResolution: 685
ObliquePixelResolution: 748
LineResolution: 628
ObliqueLineResolution: 685
ObliqueLineResolution: 748
SampleResolution: 628
ObliqueSampleResolution: 685
ObliqueSampleResolution: 748
DetectorResolution: 157
ObliqueDetectorResolution: 171
ObliqueDetectorResolution: 187
LowestImageResolution: 2047
HighestImageResolution: 430
Calling BasicMapping (pvl)...
+8 −8
Original line number Diff line number Diff line
@@ -15,10 +15,10 @@ Group = GroundPoint
  LocalRadius                = 1737400.0 <meters>
  SampleResolution           = 187.48511798825 <meters/pixel>
  LineResolution             = 187.48511798825 <meters/pixel>
  ObliqueDetectorResolution  = 187.48933248321 <meters>
  ObliquePixelResolution     = 187.48933248321 <meters/pix>
  ObliqueLineResolution      = 187.48933248321 <meters>
  ObliqueSampleResolution    = 187.48933248321 <meters>
  ObliqueDetectorResolution  = 187.49354707291 <meters>
  ObliquePixelResolution     = 187.49354707291 <meters/pix>
  ObliqueLineResolution      = 187.49354707291 <meters>
  ObliqueSampleResolution    = 187.49354707291 <meters>

  # Spacecraft Information
  SpacecraftPosition         = (216.76438021037, 54.256829538645,
@@ -77,10 +77,10 @@ Group = GroundPoint
  LocalRadius                = 1737400.0 <meters>
  SampleResolution           = 187.50339379912 <meters/pixel>
  LineResolution             = 187.50339379912 <meters/pixel>
  ObliqueDetectorResolution  = 187.52061363579 <meters>
  ObliquePixelResolution     = 187.52061363579 <meters/pix>
  ObliqueLineResolution      = 187.52061363579 <meters>
  ObliqueSampleResolution    = 187.52061363579 <meters>
  ObliqueDetectorResolution  = 187.53783505388 <meters>
  ObliquePixelResolution     = 187.53783505388 <meters/pix>
  ObliqueLineResolution      = 187.53783505388 <meters>
  ObliqueSampleResolution    = 187.53783505388 <meters>

  # Spacecraft Information
  SpacecraftPosition         = (216.76438021037, 54.256829538645,
+9 −9
Original line number Diff line number Diff line
@@ -38,21 +38,21 @@ Resolution:

ObliqueSampleResolution:
  ObliqueSampleResolutionMinimum = 244.735
  ObliqueSampleResolutionMaximum = 246.319
  ObliqueSampleResolutionAverage = 245.205
  ObliqueSampleResolutionStandardDeviation = 0.304432
  ObliqueSampleResolutionMaximum = 246.963
  ObliqueSampleResolutionAverage = 245.396
  ObliqueSampleResolutionStandardDeviation = 0.428052

ObliqueLineResolution:
  ObliqueLineResolutionMinimum = 244.735
  ObliqueLineResolutionMaximum = 246.319
  ObliqueLineResolutionAverage = 245.205
  ObliqueLineResolutionStandardDeviation = 0.304432
  ObliqueLineResolutionMaximum = 246.963
  ObliqueLineResolutionAverage = 245.396
  ObliqueLineResolutionStandardDeviation = 0.428052

ObliqueResolution:
  ObliqueResolutionMinimum = 244.735
  ObliqueResolutionMaximum = 246.319
  ObliqueResolutionAverage = 245.205
  ObliqueResolutionStandardDeviation = 0.304432
  ObliqueResolutionMaximum = 246.963
  ObliqueResolutionAverage = 245.396
  ObliqueResolutionStandardDeviation = 0.428052

AspectRatio:
  AspectRatioMinimum = 1
+15 −8
Original line number Diff line number Diff line
@@ -397,16 +397,18 @@

          <definition name="Oblique Detector Resolution"><a name="oblique_detector_resolution"></a>
            This provides an improved estimate to the standard <a href="#detector_resolution">detector resolution</a> when the image is taken at an oblique 
            angle. It returns the square-root of the area of the projection of the detector onto the body of the target (in units of meters).
            If the image is taken at nadir, this is the ground distance between the left and right edge of the detector, because the 
            detector's projection is a square.  For off-nadir images, the projection has a trapezoidal shape.
            In Figure 1A below, an image of the Dufay X crater that was taken near nadir is displayed.  Figure 1B is a
            angle.  In Figure 1A below, an image of the Dufay X crater that was taken near nadir is displayed.  Figure 1B is a
            color map showing the relative difference between the oblique detector resolution, and the original detector resolution as a function
            of the emission angle.  For small emission angles (near nadir) the relative difference between the two estimates 
            is very small.  For larger emission angles (off-nadir), the relative difference between the 
            two estimates increases rapidly.  Figure 2A is an image of the Carlini crater group taken at an oblique angle.  Figure 2B is a color plot
            of the relative difference between the two estimates showing a minimum value of approximately 50% between the two when the 
            emission angles off-nadir are in the range 65-75 degrees.
            of the relative difference between the two estimates showing a minimum of approximately 120% when the 
            emission angles off-nadir are in the range 64-75 degrees.  The traditional approximation is obviously not adequate for a case such
            as this, and the oblique detector resolution should be used.

            




		<table border = "1">
@@ -433,7 +435,7 @@
		<tr>
			<td>
			 <center>
                                 <image width="584" height="492" src="assets/nadir40pct.png">
                                 <image width="585" height="487" src="assets/nadir_scaled.png">
                                 <brief><br><strong>Fig 1B:</strong> Relative percentage difference between resolution estimates for</br>
                                 <br> a nadir image (see <strong>Fig. 1A</strong>).</br></brief>
                                 </image>
@@ -441,7 +443,7 @@
			</td>
			<td>
			<center>
                                <image width="582" height="492" src="assets/oblique40pct.png">
                                <image width="583" height="487" src="assets/oblique_scaled.png">
                                <brief><br><strong>Fig 2B:</strong> Relative percentage difference between resolution estimates for</br>
                                <br> an oblique image (see <strong>Fig. 2A</strong>).</br></brief>
                                </image>
@@ -449,6 +451,11 @@
			</td>
		</tr>
                </table>				 
      
     
         Handwritten notes by Orrin Thomas giving a geometric justification for this method can be found <a href="assets/oblique.pdf">here.</a>         
        
      
	  </definition>

          <definition name="I/F">
Loading