HuginBase::Nona::SpaceTransform Class Reference

#include <SpaceTransform.h>

List of all members.

Public Member Functions

 SpaceTransform ()
 ctor
 ~SpaceTransform ()
 dtor
void Init (const SrcPanoImage &img, const vigra::Diff2D &destSize, PanoramaOptions::ProjectionFormat destProj, double destHFOV)
 Creates the stacks of matrices and flatten them.
void InitInv (const SrcPanoImage &img, const vigra::Diff2D &destSize, PanoramaOptions::ProjectionFormat destProj, double destHFOV)
 Init Inv Transform Create the stack of matrices for reverse transform.
void InitRadialCorrect (const vigra::Size2D &sz, const std::vector< double > &radDist, const hugin_utils::FDiff2D &centerShift)
 Create a transform stack for radial distortion correction only.
void InitRadialCorrect (const SrcPanoImage &src, int channel=1)
 Create a transform stack for distortion & TCA correction only.
void InitInvRadialCorrect (const SrcPanoImage &src, int channel=1)
 Create a transform stack for distortion & TCA correction only.
void createTransform (const SrcPanoImage &src, const PanoramaOptions &dest)
void createInvTransform (const SrcPanoImage &src, const PanoramaOptions &dest)
void createTransform (const PanoramaData &pano, unsigned int imgNr, const PanoramaOptions &dest, vigra::Diff2D srcSize=vigra::Diff2D(0, 0))
void createInvTransform (const PanoramaData &pano, unsigned int imgNr, const PanoramaOptions &dest, vigra::Diff2D srcSize=vigra::Diff2D(0, 0))
void createTransform (const vigra::Diff2D &srcSize, const VariableMap &srcVars, Lens::LensProjectionFormat srcProj, const vigra::Diff2D &destSize, PanoramaOptions::ProjectionFormat destProj, double destHFOV)
void createInvTransform (const vigra::Diff2D &srcSize, const VariableMap &srcVars, Lens::LensProjectionFormat srcProj, const vigra::Diff2D &destSize, PanoramaOptions::ProjectionFormat destProj, double destHFOV)
bool transform (hugin_utils::FDiff2D &dest, const hugin_utils::FDiff2D &src) const
 transform Get the new coordinates
bool transformImgCoord (double &x_dest, double &y_dest, double x_src, double y_src) const
 like transform, but return image coordinates, not cartesian coordinates
bool transformImgCoord (hugin_utils::FDiff2D &dest, const hugin_utils::FDiff2D &src) const
bool isIdentity ()
 returns true if this transform is an identity transform

Private Member Functions

void AddTransform (trfn function_name, double var0, double var1=0.0f, double var2=0.0f, double var3=0.0f, double var4=0.0f, double var5=0.0f, double var6=0.0f, double var7=0.0f)
 add a new transformation
void AddTransform (trfn function_name, Matrix3 m, double var0, double var1=0.0f, double var2=0.0f, double var3=0.0f)

Private Attributes

bool m_Initialized
 was the class initialized ?
double m_srcTX
 used to convert from screen to cartesian coordinates
double m_srcTY
 used to convert from screen to cartesian coordinates
double m_destTX
double m_destTY
std::vector< fDescriptionm_Stack
 vector of transformations


Constructor & Destructor Documentation

HuginBase::Nona::SpaceTransform::SpaceTransform  ) 
 

ctor

Definition at line 40 of file SpaceTransform.cpp.

References m_Initialized.

HuginBase::Nona::SpaceTransform::~SpaceTransform  ) 
 

dtor

Definition at line 46 of file SpaceTransform.cpp.


Member Function Documentation

void HuginBase::Nona::SpaceTransform::AddTransform trfn  function_name,
Matrix3  m,
double  var0,
double  var1 = 0.0f,
double  var2 = 0.0f,
double  var3 = 0.0f
[private]
 

Definition at line 65 of file SpaceTransform.cpp.

References HuginBase::Nona::_FuncParams::distance, HuginBase::Nona::fDescription, HuginBase::Nona::_fDesc::func, m_Stack, HuginBase::Nona::_FuncParams::mt, HuginBase::Nona::_fDesc::param, HuginBase::Nona::_FuncParams::var1, HuginBase::Nona::_FuncParams::var2, and HuginBase::Nona::_FuncParams::var3.

void HuginBase::Nona::SpaceTransform::AddTransform trfn  function_name,
double  var0,
double  var1 = 0.0f,
double  var2 = 0.0f,
double  var3 = 0.0f,
double  var4 = 0.0f,
double  var5 = 0.0f,
double  var6 = 0.0f,
double  var7 = 0.0f
[private]
 

add a new transformation

Definition at line 50 of file SpaceTransform.cpp.

References HuginBase::Nona::fDescription, HuginBase::Nona::_fDesc::func, m_Stack, HuginBase::Nona::_fDesc::param, 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 Init(), InitInv(), InitInvRadialCorrect(), and InitRadialCorrect().

void HuginBase::Nona::SpaceTransform::createInvTransform const vigra::Diff2D &  srcSize,
const VariableMap srcVars,
Lens::LensProjectionFormat  srcProj,
const vigra::Diff2D &  destSize,
PanoramaOptions::ProjectionFormat  destProj,
double  destHFOV
 

Todo:
remove this obsolete function. Callers should use a SrcPanoImg instead

Definition at line 1678 of file SpaceTransform.cpp.

References InitInv(), HuginBase::BaseSrcPanoImage::setProjection(), HuginBase::SrcPanoImage::setSize(), and HuginBase::SrcPanoImage::setVar().

void HuginBase::Nona::SpaceTransform::createInvTransform const PanoramaData pano,
unsigned int  imgNr,
const PanoramaOptions dest,
vigra::Diff2D  srcSize = vigra::Diff2D(0, 0)
 

Definition at line 1644 of file SpaceTransform.cpp.

References HuginBase::PanoramaOptions::getHeight(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::PanoramaData::getImage(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getWidth(), and InitInv().

void HuginBase::Nona::SpaceTransform::createInvTransform const SrcPanoImage src,
const PanoramaOptions dest
 

Definition at line 1620 of file SpaceTransform.cpp.

References HuginBase::PanoramaOptions::getHeight(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getWidth(), and InitInv().

void HuginBase::Nona::SpaceTransform::createTransform const vigra::Diff2D &  srcSize,
const VariableMap srcVars,
Lens::LensProjectionFormat  srcProj,
const vigra::Diff2D &  destSize,
PanoramaOptions::ProjectionFormat  destProj,
double  destHFOV
 

Todo:
remove this obsolete function. Callers should use a SrcPanoImg instead

Definition at line 1659 of file SpaceTransform.cpp.

References Init(), HuginBase::BaseSrcPanoImage::setProjection(), HuginBase::SrcPanoImage::setSize(), and HuginBase::SrcPanoImage::setVar().

void HuginBase::Nona::SpaceTransform::createTransform const PanoramaData pano,
unsigned int  imgNr,
const PanoramaOptions dest,
vigra::Diff2D  srcSize = vigra::Diff2D(0, 0)
 

Definition at line 1628 of file SpaceTransform.cpp.

References HuginBase::PanoramaOptions::getHeight(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::PanoramaData::getImage(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getWidth(), and Init().

void HuginBase::Nona::SpaceTransform::createTransform const SrcPanoImage src,
const PanoramaOptions dest
 

Definition at line 1611 of file SpaceTransform.cpp.

References HuginBase::PanoramaOptions::getHeight(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getWidth(), and Init().

void HuginBase::Nona::SpaceTransform::Init const SrcPanoImage image,
const vigra::Diff2D &  destSize,
PanoramaOptions::ProjectionFormat  destProj,
double  destHFOV
 

Creates the stacks of matrices and flatten them.

Definition at line 1203 of file SpaceTransform.cpp.

References AddTransform(), HuginBase::Nona::CalcCorrectionRadius_copy(), DEBUG_FATAL, DEG_TO_RAD, HuginBase::Nona::erect_mercator(), HuginBase::Nona::erect_pano(), HuginBase::Nona::erect_rect(), HuginBase::Nona::erect_sinusoidal(), HuginBase::Nona::erect_sphere_tp(), HuginBase::Nona::erect_stereographic(), HuginBase::Nona::erect_transmercator(), HuginBase::Nona::horiz(), m_destTX, m_destTY, m_srcTX, m_srcTY, m_Stack, HuginBase::Nona::pano_sphere_tp(), HuginBase::Nona::persp_sphere(), PI, HuginBase::Nona::radial(), HuginBase::Nona::rect_sphere_tp(), HuginBase::Nona::resize(), HuginBase::Nona::rotate_erect(), HuginBase::Nona::SetMatrix(), HuginBase::Nona::sphere_tp_erect(), and HuginBase::Nona::vert().

Referenced by createTransform().

void HuginBase::Nona::SpaceTransform::InitInv const SrcPanoImage img,
const vigra::Diff2D &  destSize,
PanoramaOptions::ProjectionFormat  destProj,
double  destHFOV
 

Init Inv Transform Create the stack of matrices for reverse transform.

Definition at line 1414 of file SpaceTransform.cpp.

References AddTransform(), HuginBase::Nona::CalcCorrectionRadius_copy(), DEBUG_FATAL, DEG_TO_RAD, HuginBase::Nona::erect_sphere_tp(), HuginBase::Nona::horiz(), HuginBase::Nona::inv_radial(), m_destTX, m_destTY, m_srcTX, m_srcTY, m_Stack, HuginBase::Nona::mercator_erect(), HuginBase::Nona::pano_erect(), HuginBase::Nona::persp_sphere(), PI, HuginBase::Nona::rect_erect(), HuginBase::Nona::resize(), HuginBase::Nona::rotate_erect(), HuginBase::Nona::SetMatrix(), HuginBase::Nona::sphere_tp_erect(), HuginBase::Nona::sphere_tp_pano(), HuginBase::Nona::sphere_tp_rect(), HuginBase::Nona::stereographic_erect(), HuginBase::Nona::transmercator_erect(), HuginBase::Nona::transpano_erect(), and HuginBase::Nona::vert().

Referenced by createInvTransform().

void HuginBase::Nona::SpaceTransform::InitInvRadialCorrect const SrcPanoImage src,
int  channel = 1
 

Create a transform stack for distortion & TCA correction only.

Definition at line 1081 of file SpaceTransform.cpp.

References AddTransform(), HuginBase::Nona::CalcCorrectionRadius_copy(), HuginBase::SrcPanoImage::getCorrectTCA(), HuginBase::Nona::horiz(), HuginBase::Nona::inv_radial(), m_destTX, m_destTY, m_srcTX, m_srcTY, m_Stack, and HuginBase::Nona::vert().

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

void HuginBase::Nona::SpaceTransform::InitRadialCorrect const SrcPanoImage src,
int  channel = 1
 

Create a transform stack for distortion & TCA correction only.

Definition at line 1139 of file SpaceTransform.cpp.

References AddTransform(), HuginBase::Nona::CalcCorrectionRadius_copy(), DEBUG_DEBUG, HuginBase::SrcPanoImage::getCorrectTCA(), HuginBase::Nona::horiz(), m_destTX, m_destTY, m_srcTX, m_srcTY, m_Stack, HuginBase::Nona::radial(), and HuginBase::Nona::vert().

void HuginBase::Nona::SpaceTransform::InitRadialCorrect const vigra::Size2D &  sz,
const std::vector< double > &  radDist,
const hugin_utils::FDiff2D centerShift
 

Create a transform stack for radial distortion correction only.

Definition at line 1051 of file SpaceTransform.cpp.

References AddTransform(), HuginBase::Nona::CalcCorrectionRadius_copy(), hugin_utils::FDiff2D, m_destTX, m_destTY, m_srcTX, m_srcTY, m_Stack, HuginBase::Nona::radial_shift(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by correctImage().

bool HuginBase::Nona::SpaceTransform::isIdentity  )  [inline]
 

returns true if this transform is an identity transform

Definition at line 177 of file SpaceTransform.h.

Referenced by correctImage().

bool HuginBase::Nona::SpaceTransform::transform hugin_utils::FDiff2D dest,
const hugin_utils::FDiff2D src
const
 

transform Get the new coordinates

Definition at line 1698 of file SpaceTransform.cpp.

References hugin_utils::FDiff2D, m_Stack, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by transformImgCoord().

bool HuginBase::Nona::SpaceTransform::transformImgCoord hugin_utils::FDiff2D dest,
const hugin_utils::FDiff2D src
const [inline]
 

Definition at line 169 of file SpaceTransform.h.

References hugin_utils::FDiff2D, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

bool HuginBase::Nona::SpaceTransform::transformImgCoord double &  x_dest,
double &  y_dest,
double  x_src,
double  y_src
const
 

like transform, but return image coordinates, not cartesian coordinates

Definition at line 1715 of file SpaceTransform.cpp.

References hugin_utils::FDiff2D, m_destTX, m_destTY, m_srcTX, m_srcTY, transform(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.


Member Data Documentation

double HuginBase::Nona::SpaceTransform::m_destTX [private]
 

Definition at line 195 of file SpaceTransform.h.

Referenced by Init(), InitInv(), InitInvRadialCorrect(), InitRadialCorrect(), and transformImgCoord().

double HuginBase::Nona::SpaceTransform::m_destTY [private]
 

Definition at line 195 of file SpaceTransform.h.

Referenced by Init(), InitInv(), InitInvRadialCorrect(), InitRadialCorrect(), and transformImgCoord().

bool HuginBase::Nona::SpaceTransform::m_Initialized [private]
 

was the class initialized ?

Definition at line 191 of file SpaceTransform.h.

Referenced by SpaceTransform().

double HuginBase::Nona::SpaceTransform::m_srcTX [private]
 

used to convert from screen to cartesian coordinates

Definition at line 194 of file SpaceTransform.h.

Referenced by Init(), InitInv(), InitInvRadialCorrect(), InitRadialCorrect(), and transformImgCoord().

double HuginBase::Nona::SpaceTransform::m_srcTY [private]
 

used to convert from screen to cartesian coordinates

Definition at line 194 of file SpaceTransform.h.

Referenced by Init(), InitInv(), InitInvRadialCorrect(), InitRadialCorrect(), and transformImgCoord().

std::vector<fDescription> HuginBase::Nona::SpaceTransform::m_Stack [private]
 

vector of transformations

Definition at line 198 of file SpaceTransform.h.

Referenced by AddTransform(), Init(), InitInv(), InitInvRadialCorrect(), InitRadialCorrect(), and transform().


The documentation for this class was generated from the following files:
Generated on Sun Apr 20 01:25:52 2014 for Hugintrunk by  doxygen 1.3.9.1