ldpk
tde4_ldp_radial_fisheye_stereographic_deg_8.experimental.h
1 #pragma once
2 
3 #include <ldpk/tde4_ldp_radial_fisheye_base_deg_8.experimental.h>
4 
7 
10 template <class VEC2,class MAT2>
12  {
13 private:
14  typedef VEC2 vec2_type;
15  typedef MAT2 mat2_type;
17  using base_type::_fl_dn;
18  using base_type::_r_clip_factor;
19 
20  bool remap_fe2plain(double r_ed_dn,double& r_plain_dn)
21  {
22  typedef base_type bt;
23  bool rc = true;
24 // Angular elongation in stereographic lenses
25  double arg = r_ed_dn / (2.0 * _fl_dn);
26 // stereographic has a maximum elongation of 180 degree.
27  double theta = 2.0 * ::atan(arg);
28 // We can only visualize ]-90deg,+90deg[ in plain images.
29  if(theta >= M_PI / 2.0)
30  { return false; }
31 // Now remap to distance in plain filmback
32  r_plain_dn = _fl_dn * tan(theta);
33 // Optionally clip distance.
34  if(r_plain_dn > _r_clip_factor)
35  { r_plain_dn = _r_clip_factor; }
36  return true;
37  }
38  bool remap_plain2fe(double r_plain_dn,double& r_ed_dn)
39  {
40  typedef base_type bt;
41 // Angular elongation in gnomonic lenses: theta = arctan(r / f)
42  double theta = atan2(r_plain_dn,_fl_dn);
43 // Now remap to distance in stereographic lens
44  r_ed_dn = 2.0 * _fl_dn * ::tan(theta * (1.0/2.0));
45  return true;
46  }
47  bool getModelName(char *name)
48  {
49 #ifdef LDPK_COMPILE_AS_PLUGIN_SDV
50  strcpy(name,"3DE4 Radial - Fisheye, Stereographic, Degree 8 [Plugin]");
51 #else
52  strcpy(name,"3DE4 Radial - Fisheye, Stereographic, Degree 8");
53 #endif
54  return true;
55  }
56  };
Plugin class for radial distortion. Does not compensate for decentering.
Definition: tde4_ldp_radial_fisheye_base_deg_8.experimental.h:14
Plugin class for radial distortion. Does not compensate for decentering.
Definition: tde4_ldp_radial_fisheye_stereographic_deg_8.experimental.h:11