OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimSmacCallibrationSystem.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts
6 //
7 // Description:
8 //
9 // Proecedure for compensation of aerial camera lens distortion
10 // as computed by the Simultaneous Multiframe Analytical Calibration
11 // (SMAC) System:
12 //
13 //*******************************************************************
14 // $Id$
16 #include <cmath>
17 #include <iostream>
18 
20 {
21  double x = input.x - theCenter.x;
22  double y = input.y - theCenter.y;
23  double x2 = x*x;
24  double y2 = y*y;
25  double r = std::sqrt(x2 + y2);
26  double r2 = r*r;
27  double r4 = r2*r2;
28  double r6 = r2*r4;
29  double r8 = r4*r4;
35  double DXr = x*(sum);
36  double DYr = y*(sum);
41 
42  output.x = x + DXr + DXd;
43  output.y = y + DYr + DYd;
44 }
45 
47 {
48  // this example was grabbed from a sample callibration report;
49  double k0 = -.2165e-3;
50  double k1 = .4230e-7;
51  double k2 = -.1652e-11;
52  double k3 = .2860e-19;
53  double k4 = .5690e-26;
54  double p1 = -.1483e-6;
55  double p2 = .1558e-6;
56  double p3 = -.1464e-18;
57  double p4 = .1233e-38;
58 
59  ossimSmacCallibrationSystem smac(k0, k1, k2, k3, k4,
60  p1, p2, p3, p4,
61  ossimDpt(.003, -.001));
62  ossimDpt output;
63  smac.undistort(ossimDpt(62.142, -62.336), output);
64  std::cout << "Input: " << ossimDpt(62.142, -62.336) << std::endl;
65  std::cout << "Output should be close to x = 62.136 and y = -62.332 <====> " << output << std::endl;
66  ossimDpt input = output;
67  std::cout << "Now test the inverse!" << std::endl;
68  smac.distort(input, output);
69 
70  std::cout << "Inverse should be close to " << ossimDpt(62.142, -62.336) << " <=====> " << output << std::endl;
71 }
72 
ossim_uint32 x
double _decenteringDistortionCoefficients[4]
The coeeficients are arranged index 0..N-1 where 0 refers to P1 ...
ossim_uint32 y
double y
Definition: ossimDpt.h:165
double _symmetricRadialDistortionCoefficients[5]
The coeeficients are arranged index 0..N-1 where 0 refers to K&#39;0 ...
virtual void undistort(const ossimDpt &input, ossimDpt &output) const
Proecedure for compensation of aerial camera lens distortion as computed by the Simultaneous Multif...
double x
Definition: ossimDpt.h:164
virtual void distort(const ossimDpt &input, ossimDpt &output) const