Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HuginBase::Nona::SpaceTransform Class Reference

#include <SpaceTransform.h>

Public Member Functions

 SpaceTransform ()
 ctor. More...
 
 ~SpaceTransform ()
 dtor. More...
 
void Init (const SrcPanoImage &img, const vigra::Diff2D &destSize, PanoramaOptions::ProjectionFormat destProj, double destHFOV)
 Init Transform Create the stack of matrices for direct transform. More...
 
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. More...
 
void InitRadialCorrect (const vigra::Size2D &sz, const std::vector< double > &radDist, const hugin_utils::FDiff2D &centerShift)
 transformation for radial correction only More...
 
void InitRadialCorrect (const SrcPanoImage &src, int channel=1)
 init radial correction from pano image description and selected channel (R=0, G=1, B=2), (TCA corr) More...
 
void InitInvRadialCorrect (const SrcPanoImage &src, int channel=1)
 Create a transform stack for distortion & TCA correction only. More...
 
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 More...
 
bool transformImgCoord (double &x_dest, double &y_dest, double x_src, double y_src) const
 like transform, but return image coordinates, not cartesian coordinates More...
 
bool transformImgCoord (hugin_utils::FDiff2D &dest, const hugin_utils::FDiff2D &src) const
 
bool isIdentity ()
 returns true if this transform is an identity transform More...
 

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 More...
 
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 ? More...
 
double m_srcTX
 used to convert from screen to cartesian coordinates More...
 
double m_srcTY
 
double m_destTX
 
double m_destTY
 
std::vector< fDescriptionm_Stack
 vector of transformations More...
 

Detailed Description

Definition at line 84 of file SpaceTransform.h.

Constructor & Destructor Documentation

HuginBase::Nona::SpaceTransform::SpaceTransform ( )

ctor.

ctor

Definition at line 34 of file SpaceTransform.cpp.

References m_Initialized.

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

dtor.

dtor

Definition at line 41 of file SpaceTransform.cpp.

Member Function Documentation

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
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
void HuginBase::Nona::SpaceTransform::createInvTransform ( const SrcPanoImage src,
const PanoramaOptions dest 
)
void HuginBase::Nona::SpaceTransform::createInvTransform ( const PanoramaData pano,
unsigned int  imgNr,
const PanoramaOptions dest,
vigra::Diff2D  srcSize = vigra::Diff2D(0,0) 
)
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 1673 of file SpaceTransform.cpp.

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

void HuginBase::Nona::SpaceTransform::createTransform ( const SrcPanoImage src,
const PanoramaOptions dest 
)
void HuginBase::Nona::SpaceTransform::createTransform ( const PanoramaData pano,
unsigned int  imgNr,
const PanoramaOptions dest,
vigra::Diff2D  srcSize = vigra::Diff2D(0,0) 
)
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 1654 of file SpaceTransform.cpp.

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

void HuginBase::Nona::SpaceTransform::Init ( const SrcPanoImage image,
const vigra::Diff2D &  destSize,
PanoramaOptions::ProjectionFormat  destProj,
double  destHFOV 
)
void HuginBase::Nona::SpaceTransform::InitInv ( const SrcPanoImage img,
const vigra::Diff2D &  destSize,
PanoramaOptions::ProjectionFormat  destProj,
double  destHFOV 
)
void HuginBase::Nona::SpaceTransform::InitInvRadialCorrect ( const SrcPanoImage src,
int  channel = 1 
)
void HuginBase::Nona::SpaceTransform::InitRadialCorrect ( const vigra::Size2D &  sz,
const std::vector< double > &  radDist,
const hugin_utils::FDiff2D centerShift 
)

transformation for radial correction only

Create a transform stack for radial distortion correction only.

Definition at line 1046 of file SpaceTransform.cpp.

References AddTransform(), HuginBase::Nona::CalcCorrectionRadius_copy(), 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().

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

init radial correction from pano image description and selected channel (R=0, G=1, B=2), (TCA corr)

Create a transform stack for distortion & TCA correction only.

Definition at line 1134 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().

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 1693 of file SpaceTransform.cpp.

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

Referenced by transformImgCoord().

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 1710 of file SpaceTransform.cpp.

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

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::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Member Data Documentation

double HuginBase::Nona::SpaceTransform::m_destTX
private
double HuginBase::Nona::SpaceTransform::m_destTY
private
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
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: