Hugintrunk
0.1
|
#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 ¢erShift) |
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< fDescription > | m_Stack |
vector of transformations More... | |
Definition at line 84 of file SpaceTransform.h.
HuginBase::Nona::SpaceTransform::SpaceTransform | ( | ) |
HuginBase::Nona::SpaceTransform::~SpaceTransform | ( | ) |
|
private |
add a new transformation
Definition at line 45 of file SpaceTransform.cpp.
References HuginBase::Nona::_fDesc::func, m_Stack, HuginBase::Nona::_fDesc::param, var0, HuginBase::Nona::_FuncParams::var0, var1, HuginBase::Nona::_FuncParams::var1, var2, HuginBase::Nona::_FuncParams::var2, var3, HuginBase::Nona::_FuncParams::var3, var4, HuginBase::Nona::_FuncParams::var4, var5, HuginBase::Nona::_FuncParams::var5, HuginBase::Nona::_FuncParams::var6, and HuginBase::Nona::_FuncParams::var7.
Referenced by Init(), InitInv(), InitInvRadialCorrect(), and InitRadialCorrect().
|
private |
Definition at line 60 of file SpaceTransform.cpp.
References HuginBase::Nona::_FuncParams::distance, HuginBase::Nona::_fDesc::func, m_Stack, HuginBase::Nona::_FuncParams::mt, HuginBase::Nona::_fDesc::param, var0, var1, HuginBase::Nona::_FuncParams::var1, var2, HuginBase::Nona::_FuncParams::var2, var3, and HuginBase::Nona::_FuncParams::var3.
void HuginBase::Nona::SpaceTransform::createInvTransform | ( | const SrcPanoImage & | src, |
const PanoramaOptions & | dest | ||
) |
Definition at line 1615 of file SpaceTransform.cpp.
References HuginBase::PanoramaOptions::getHeight(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getWidth(), and InitInv().
void HuginBase::Nona::SpaceTransform::createInvTransform | ( | const PanoramaData & | pano, |
unsigned int | imgNr, | ||
const PanoramaOptions & | dest, | ||
vigra::Diff2D | srcSize = vigra::Diff2D(0,0) |
||
) |
Definition at line 1639 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 vigra::Diff2D & | srcSize, |
const VariableMap & | srcVars, | ||
Lens::LensProjectionFormat | srcProj, | ||
const vigra::Diff2D & | destSize, | ||
PanoramaOptions::ProjectionFormat | destProj, | ||
double | destHFOV | ||
) |
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 | ||
) |
Definition at line 1606 of file SpaceTransform.cpp.
References HuginBase::PanoramaOptions::getHeight(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getWidth(), and Init().
void HuginBase::Nona::SpaceTransform::createTransform | ( | const PanoramaData & | pano, |
unsigned int | imgNr, | ||
const PanoramaOptions & | dest, | ||
vigra::Diff2D | srcSize = vigra::Diff2D(0,0) |
||
) |
Definition at line 1623 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 vigra::Diff2D & | srcSize, |
const VariableMap & | srcVars, | ||
Lens::LensProjectionFormat | srcProj, | ||
const vigra::Diff2D & | destSize, | ||
PanoramaOptions::ProjectionFormat | destProj, | ||
double | destHFOV | ||
) |
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 | ||
) |
Init Transform Create the stack of matrices for direct transform.
Creates the stacks of matrices and flatten them.
Definition at line 1198 of file SpaceTransform.cpp.
References AddTransform(), HuginBase::Nona::CalcCorrectionRadius_copy(), HuginBase::PanoramaOptions::CYLINDRICAL, DEBUG_FATAL, DEG_TO_RAD, HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR, HuginBase::PanoramaOptions::EQUIRECTANGULAR, 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::PanoramaOptions::FULL_FRAME_FISHEYE, HuginBase::Nona::horiz(), m_destTX, m_destTY, m_srcTX, m_srcTY, m_Stack, HuginBase::PanoramaOptions::MERCATOR, HuginBase::Nona::pano_sphere_tp(), HuginBase::BaseSrcPanoImage::PANORAMIC, HuginBase::Nona::persp_sphere(), PI, HuginBase::Nona::radial(), HuginBase::Nona::rect_sphere_tp(), HuginBase::BaseSrcPanoImage::RECTILINEAR, HuginBase::PanoramaOptions::RECTILINEAR, HuginBase::Nona::resize(), HuginBase::Nona::rotate_erect(), HuginBase::Nona::SetMatrix(), HuginBase::PanoramaOptions::SINUSOIDAL, HuginBase::Nona::sphere_tp_erect(), HuginBase::PanoramaOptions::STEREOGRAPHIC, HuginBase::PanoramaOptions::TRANSVERSE_MERCATOR, 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 1409 of file SpaceTransform.cpp.
References AddTransform(), HuginBase::Nona::CalcCorrectionRadius_copy(), HuginBase::PanoramaOptions::CYLINDRICAL, DEBUG_FATAL, DEG_TO_RAD, HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR, HuginBase::PanoramaOptions::EQUIRECTANGULAR, HuginBase::Nona::erect_sphere_tp(), HuginBase::PanoramaOptions::FULL_FRAME_FISHEYE, HuginBase::Nona::horiz(), HuginBase::Nona::inv_radial(), m_destTX, m_destTY, m_srcTX, m_srcTY, m_Stack, HuginBase::PanoramaOptions::MERCATOR, HuginBase::Nona::mercator_erect(), HuginBase::Nona::pano_erect(), HuginBase::BaseSrcPanoImage::PANORAMIC, HuginBase::Nona::persp_sphere(), PI, HuginBase::Nona::rect_erect(), HuginBase::BaseSrcPanoImage::RECTILINEAR, HuginBase::PanoramaOptions::RECTILINEAR, HuginBase::Nona::resize(), HuginBase::Nona::rotate_erect(), HuginBase::Nona::SetMatrix(), HuginBase::PanoramaOptions::SINUSOIDAL, HuginBase::Nona::sphere_tp_erect(), HuginBase::Nona::sphere_tp_pano(), HuginBase::Nona::sphere_tp_rect(), HuginBase::PanoramaOptions::STEREOGRAPHIC, HuginBase::Nona::stereographic_erect(), HuginBase::Nona::transmercator_erect(), HuginBase::Nona::transpano_erect(), HuginBase::PanoramaOptions::TRANSVERSE_MERCATOR, 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 1076 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 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().
|
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.
|
inline |
Definition at line 169 of file SpaceTransform.h.
References hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.
|
private |
Definition at line 195 of file SpaceTransform.h.
Referenced by Init(), InitInv(), InitInvRadialCorrect(), InitRadialCorrect(), and transformImgCoord().
|
private |
Definition at line 195 of file SpaceTransform.h.
Referenced by Init(), InitInv(), InitInvRadialCorrect(), InitRadialCorrect(), and transformImgCoord().
|
private |
was the class initialized ?
Definition at line 191 of file SpaceTransform.h.
Referenced by SpaceTransform().
|
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().
|
private |
Definition at line 194 of file SpaceTransform.h.
Referenced by Init(), InitInv(), InitInvRadialCorrect(), InitRadialCorrect(), and transformImgCoord().
|
private |
vector of transformations
Definition at line 198 of file SpaceTransform.h.
Referenced by AddTransform(), Init(), InitInv(), InitInvRadialCorrect(), InitRadialCorrect(), and transform().