SpaceTransform.cpp File Reference

implementation of Space Transformation More...

#include "SpaceTransform.h"

Include dependency graph for SpaceTransform.cpp:

Include dependency graph

Go to the source code of this file.

Namespaces

namespace  HuginBase
namespace  HuginBase::Nona

Defines

#define MAXITER   100
#define R_EPS   1.0e-6

Functions

void rotate_erect (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void inv_radial (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void resize (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void horiz (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void vert (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void radial (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void persp_sphere (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void persp_rect (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void rect_erect (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void pano_erect (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void erect_pano (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void transpano_erect (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void erect_transpano (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void sphere_tp_erect (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void rect_sphere_tp (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void sphere_tp_rect (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void sphere_tp_pano (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void pano_sphere_tp (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void erect_rect (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void erect_sphere_tp (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
void mercator_erect (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
 convert from erect to mercator
void erect_mercator (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
 convert from mercator to erect
void transmercator_erect (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
 convert from erect to transverse mercator
void erect_transmercator (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
 convert from erect to transverse mercator
void sinusoidal_erect (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
 convert from erect to sinusoidal
void erect_sinusoidal (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
 convert from sinusoidal to erect
void stereographic_erect (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
 convert from erect to stereographic
void erect_stereographic (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
 convert from stereographic to erect
void cubeZero_copy (double *a, int *n, double *root)
void squareZero_copy (double *a, int *n, double *root)
double cubeRoot_copy (double x)
double smallestRoot_copy (double *p)
double CalcCorrectionRadius_copy (double *coeff)
void radial_shift (double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams &params)
Matrix3 SetMatrix (double a, double b, double c, int cl)
double estScaleFactorForFullFrame (const SrcPanoImage &src)
 Calculate effective scaling factor for a given source image.
double estRadialScaleCrop (const vector< double > &coeff, int width, int height)
 Calculate effective scaling factor.


Detailed Description

implementation of Space Transformation

Author:
Alexandre Jenny <alexandre.jenny@le-geo.com>
$Id$

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this software; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Definition in file SpaceTransform.cpp.


Define Documentation

#define MAXITER   100
 

Definition at line 83 of file SpaceTransform.cpp.

#define R_EPS   1.0e-6
 

Definition at line 84 of file SpaceTransform.cpp.

Referenced by HuginBase::Nona::inv_radial().


Function Documentation

double CalcCorrectionRadius_copy double *  coeff  )  [static]
 

Definition at line 884 of file SpaceTransform.cpp.

References HuginBase::Nona::smallestRoot_copy().

Referenced by HuginBase::Nona::SpaceTransform::Init(), HuginBase::Nona::SpaceTransform::InitInv(), HuginBase::Nona::SpaceTransform::InitInvRadialCorrect(), and HuginBase::Nona::SpaceTransform::InitRadialCorrect().

double HuginBase::Nona::cubeRoot_copy double  x  )  [static]
 

Definition at line 857 of file SpaceTransform.cpp.

References vigra_ext::pow().

Referenced by HuginBase::Nona::cubeZero_copy().

void HuginBase::Nona::cubeZero_copy double *  a,
int *  n,
double *  root
[static]
 

Definition at line 813 of file SpaceTransform.cpp.

References HuginBase::Nona::cubeRoot_copy(), PI, and HuginBase::Nona::squareZero_copy().

Referenced by HuginBase::Nona::smallestRoot_copy().

void erect_mercator double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

convert from mercator to erect

Definition at line 524 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::Init().

void erect_pano double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 334 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::Init().

void erect_rect double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 488 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::Init().

void erect_sinusoidal double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

convert from sinusoidal to erect

Definition at line 563 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::Init().

void erect_sphere_tp double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 496 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::Init(), and HuginBase::Nona::SpaceTransform::InitInv().

void erect_stereographic double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

convert from stereographic to erect

Definition at line 585 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::Init().

void erect_transmercator double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

convert from erect to transverse mercator

Definition at line 544 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::Init().

void erect_transpano double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 350 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

double estRadialScaleCrop const std::vector< double > &  coeff,
int  width,
int  height
 

Calculate effective scaling factor.

This function returns the smalles scale factor that has been applied

If values < 1 are returned, black borders will occur. In that case the distortion correction parameters might need to be adjusted to avoid the black borders.

Parameters:
coef1 lens distortion coefficients, including d coefficient.
width image width
height image height
Returns:
smallest r_corr / r_orig in areas that might lead to black borders.

Definition at line 969 of file SpaceTransform.cpp.

IMPEX double HuginBase::Nona::estScaleFactorForFullFrame const SrcPanoImage &  src  ) 
 

Calculate effective scaling factor for a given source image.

Definition at line 945 of file SpaceTransform.cpp.

References HuginBase::SrcPanoImage::getCorrectTCA(), HuginBase::Nona::SpaceTransform::InitInvRadialCorrect(), celeste::max(), and HuginBase::Nona::traceImageOutline().

Referenced by correctImage().

void horiz double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 173 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::shift.

Referenced by HuginBase::Nona::SpaceTransform::Init(), HuginBase::Nona::SpaceTransform::InitInv(), HuginBase::Nona::SpaceTransform::InitInvRadialCorrect(), and HuginBase::Nona::SpaceTransform::InitRadialCorrect().

void inv_radial double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 100 of file SpaceTransform.cpp.

References R_EPS, HuginBase::Nona::_FuncParams::var0, HuginBase::Nona::_FuncParams::var1, HuginBase::Nona::_FuncParams::var2, HuginBase::Nona::_FuncParams::var3, and HuginBase::Nona::_FuncParams::var4.

Referenced by HuginBase::Nona::SpaceTransform::InitInv(), and HuginBase::Nona::SpaceTransform::InitInvRadialCorrect().

void mercator_erect double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

convert from erect to mercator

Definition at line 516 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance, and vigra_ext::log().

Referenced by HuginBase::Nona::SpaceTransform::InitInv().

void pano_erect double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 326 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::InitInv().

void pano_sphere_tp double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 457 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::Init().

void persp_rect double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 272 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::mt, Matrix3::TransformVector(), HuginBase::Nona::_FuncParams::var1, HuginBase::Nona::_FuncParams::var2, HuginBase::Nona::_FuncParams::var3, Vector3::x, Vector3::y, and Vector3::z.

void persp_sphere double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 242 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance, HuginBase::Nona::_FuncParams::mt, Matrix3::TransformVector(), Vector3::x, Vector3::y, and Vector3::z.

Referenced by HuginBase::Nona::SpaceTransform::Init(), and HuginBase::Nona::SpaceTransform::InitInv().

void radial double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 189 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::var0, HuginBase::Nona::_FuncParams::var1, HuginBase::Nona::_FuncParams::var2, HuginBase::Nona::_FuncParams::var3, HuginBase::Nona::_FuncParams::var4, and HuginBase::Nona::_FuncParams::var5.

Referenced by HuginBase::Nona::SpaceTransform::Init(), and HuginBase::Nona::SpaceTransform::InitRadialCorrect().

void radial_shift double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
[static]
 

Definition at line 901 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::var0, HuginBase::Nona::_FuncParams::var1, HuginBase::Nona::_FuncParams::var2, HuginBase::Nona::_FuncParams::var3, HuginBase::Nona::_FuncParams::var4, HuginBase::Nona::_FuncParams::var5, HuginBase::Nona::_FuncParams::var6, and HuginBase::Nona::_FuncParams::var7.

Referenced by HuginBase::Nona::SpaceTransform::InitRadialCorrect().

void rect_erect double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 303 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance, and PI.

Referenced by HuginBase::Nona::SpaceTransform::InitInv().

void rect_sphere_tp double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 412 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance, and PI.

Referenced by HuginBase::Nona::SpaceTransform::Init().

void resize double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 155 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::var0, and HuginBase::Nona::_FuncParams::var1.

Referenced by HuginBase::Nona::SpaceTransform::Init(), HuginBase::Nona::SpaceTransform::InitInv(), and HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::setPanoImage().

void rotate_erect double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 87 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::var0, and HuginBase::Nona::_FuncParams::var1.

Referenced by HuginBase::Nona::SpaceTransform::Init(), and HuginBase::Nona::SpaceTransform::InitInv().

Matrix3 SetMatrix double  a,
double  b,
double  c,
int  cl
 

Definition at line 922 of file SpaceTransform.cpp.

References Matrix3::SetRotationX(), Matrix3::SetRotationY(), and Matrix3::SetRotationZ().

Referenced by HuginBase::Nona::SpaceTransform::Init(), and HuginBase::Nona::SpaceTransform::InitInv().

void sinusoidal_erect double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

convert from erect to sinusoidal

Definition at line 554 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

double smallestRoot_copy double *  p  )  [static]
 

Definition at line 866 of file SpaceTransform.cpp.

References HuginBase::Nona::cubeZero_copy().

Referenced by HuginBase::Nona::CalcCorrectionRadius_copy().

void sphere_tp_erect double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 371 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance, and PI.

Referenced by HuginBase::Nona::SpaceTransform::Init(), and HuginBase::Nona::SpaceTransform::InitInv().

void sphere_tp_pano double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 444 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::InitInv().

void sphere_tp_rect double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 430 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::InitInv().

void HuginBase::Nona::squareZero_copy double *  a,
int *  n,
double *  root
[static]
 

Definition at line 834 of file SpaceTransform.cpp.

Referenced by HuginBase::Nona::cubeZero_copy().

void stereographic_erect double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

convert from erect to stereographic

Definition at line 572 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::InitInv().

void transmercator_erect double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

convert from erect to transverse mercator

Definition at line 533 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::InitInv().

void transpano_erect double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 342 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance.

Referenced by HuginBase::Nona::SpaceTransform::InitInv().

void vert double  x_dest,
double  y_dest,
double *  x_src,
double *  y_src,
const _FuncParams &  params
 

Definition at line 181 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::shift.

Referenced by HuginBase::Nona::SpaceTransform::Init(), HuginBase::Nona::SpaceTransform::InitInv(), HuginBase::Nona::SpaceTransform::InitInvRadialCorrect(), and HuginBase::Nona::SpaceTransform::InitRadialCorrect().


Generated on Wed Jul 30 01:25:49 2014 for Hugintrunk by  doxygen 1.3.9.1