HuginBase::PTools::Transform Class Reference

Holds transformations for Image -> Pano and the other way. More...

#include <PanoToolsInterface.h>

List of all members.

Public Member Functions

 Transform ()
 construct a new Transform object, without initializing a transformation
 ~Transform ()
void createTransform (const vigra::Diff2D &srcSize, VariableMap srcVars, Lens::LensProjectionFormat srcProj, const vigra::Diff2D &destSize, PanoramaOptions::ProjectionFormat destProj, const std::vector< double > &destProjParam, double destHFOV, const vigra::Diff2D &origSrcSize)
 initialize pano->image transformation
void createTransform (const PanoramaData &pano, unsigned int imgNr, const PanoramaOptions &dest, vigra::Diff2D srcSize=vigra::Diff2D(0, 0))
 create pano -> img transform
void createTransform (const SrcPanoImage &src, const PanoramaOptions &dest)
void createInvTransform (const vigra::Diff2D &srcSize, VariableMap srcVars, Lens::LensProjectionFormat srcProj, const vigra::Diff2D &destSize, PanoramaOptions::ProjectionFormat destProj, const std::vector< double > &destProjParam, double destHFOV, const vigra::Diff2D &origSrcSize)
 create image->pano transformation
void createInvTransform (const PanoramaData &pano, unsigned int imgNr, const PanoramaOptions &dest, vigra::Diff2D srcSize=vigra::Diff2D(0, 0))
 create image->pano transformation
void createInvTransform (const SrcPanoImage &src, const PanoramaOptions &dest)
 create image->pano transformation
bool transform (double &x_dest, double &y_dest, double x_src, double y_src) const
 excecute transform
bool transform (hugin_utils::FDiff2D &dest, const hugin_utils::FDiff2D &src) const
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 transformImgCoordPartial (double &x_dest, double &y_dest, double x_src, double y_src) const
bool transformImgCoord (hugin_utils::FDiff2D &dest, const hugin_utils::FDiff2D &src) const
bool emitGLSL (std::ostringstream &oss) const

Private Member Functions

 Transform (const Transform &)
Transformoperator= (const Transform &)
void updatePTData (const vigra::Diff2D &srcSize, const VariableMap &srcVars, Lens::LensProjectionFormat &srcProj, const vigra::Diff2D &destSize, PanoramaOptions::ProjectionFormat &destProj, const std::vector< double > &destProjParam, double destHFOV)

Private Attributes

bool m_initialized
Image m_srcImage
Image m_dstImage
MakeParams m_mp
fDesc m_stack [15]
double m_srcTX
double m_srcTY
double m_destTX
double m_destTY


Detailed Description

Holds transformations for Image -> Pano and the other way.

Definition at line 105 of file PanoToolsInterface.h.


Constructor & Destructor Documentation

HuginBase::PTools::Transform::Transform (  )  [inline]

construct a new Transform object, without initializing a transformation

use createTransform or createInvTransform to create a transformation, and transform to execute it.

Definition at line 115 of file PanoToolsInterface.h.

HuginBase::PTools::Transform::~Transform (  ) 

Definition at line 42 of file PanoToolsInterface.cpp.

References HuginBase::PTools::freeImage(), m_dstImage, m_initialized, and m_srcImage.

HuginBase::PTools::Transform::Transform ( const Transform  )  [private]


Member Function Documentation

void HuginBase::PTools::Transform::createInvTransform ( const SrcPanoImage src,
const PanoramaOptions dest 
)

create image->pano transformation

Definition at line 88 of file PanoToolsInterface.cpp.

References createInvTransform(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getProjectionParameters(), and HuginBase::PanoramaOptions::getSize().

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

create image->pano transformation

Definition at line 188 of file PanoToolsInterface.cpp.

References createInvTransform(), HuginBase::PanoramaOptions::getHeight(), HuginBase::SrcPanoImage::getHeight(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::PanoramaData::getImage(), HuginBase::PanoramaData::getImageVariables(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getProjectionParameters(), HuginBase::PanoramaOptions::getWidth(), and HuginBase::SrcPanoImage::getWidth().

void HuginBase::PTools::Transform::createInvTransform ( const vigra::Diff2D &  srcSize,
VariableMap  srcVars,
Lens::LensProjectionFormat  srcProj,
const vigra::Diff2D &  destSize,
PanoramaOptions::ProjectionFormat  destProj,
const std::vector< double > &  destProjParam,
double  destHFOV,
const vigra::Diff2D &  origSrcSize 
)

create image->pano transformation

Parameters:
srcSize size of input image
variables of input image
srcProj projection of the image
destSize output panorama size
destProj panorama projection
destHFOV HFOV of panorama
origSrcSize original input image size, 0,0 if the same as srcSize.
origSrcSize is needed, because the variables are only valid for the original input size. To transform a smaller image, like a preview image, the parameters have to be adjusted. The origial image size, for which variables are valid needs to be know for this.

Definition at line 206 of file PanoToolsInterface.cpp.

References m_destTX, m_destTY, m_dstImage, m_mp, m_srcImage, m_srcTX, m_srcTY, m_stack, map_get(), and updatePTData().

Referenced by HuginBase::PTOptEstimator::agree(), createInvTransform(), LensCalImageCtrl::DrawView(), HuginBase::CalculateFitPanorama::fitPano(), GreatCircleArc::GreatCircleArc(), main(), OutputProjectionInfo::OutputProjectionInfo(), HuginBase::PanoramaOptions::setVFOV(), VertexCoordRemapper::UpdateAndResetIndex(), LayoutRemapper::UpdateAndResetIndex(), PreviewLayoutLinesTool::updateImageCentres(), and work_on_triplets().

void HuginBase::PTools::Transform::createTransform ( const SrcPanoImage src,
const PanoramaOptions dest 
)

Definition at line 122 of file PanoToolsInterface.cpp.

References createTransform(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getProjectionParameters(), and HuginBase::PanoramaOptions::getSize().

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

create pano -> img transform

Definition at line 70 of file PanoToolsInterface.cpp.

References createTransform(), HuginBase::PanoramaOptions::getHeight(), HuginBase::SrcPanoImage::getHeight(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::PanoramaData::getImage(), HuginBase::PanoramaData::getImageVariables(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getProjectionParameters(), HuginBase::PanoramaOptions::getWidth(), and HuginBase::SrcPanoImage::getWidth().

void HuginBase::PTools::Transform::createTransform ( const vigra::Diff2D &  srcSize,
VariableMap  srcVars,
Lens::LensProjectionFormat  srcProj,
const vigra::Diff2D &  destSize,
PanoramaOptions::ProjectionFormat  destProj,
const std::vector< double > &  destProjParam,
double  destHFOV,
const vigra::Diff2D &  origSrcSize 
)

initialize pano->image transformation

Steps of transform:

1. pano_proj -> erect 2. rotate equirect?? ( rotate yaw in screenpoints ? ) 3. spherical -> erect ?? 4. persp_sphere ( rotate point with rotation matrix) 5. sphere_tp -> image_proj 6. distortion correction 7. shift image origin 8. shear image

Definition at line 158 of file PanoToolsInterface.cpp.

References m_destTX, m_destTY, m_dstImage, m_mp, m_srcImage, m_srcTX, m_srcTY, m_stack, map_get(), and updatePTData().

Referenced by HuginBase::PTOptEstimator::agree(), HuginBase::CalculateOptimalScale::calcOptimalPanoScale(), HuginBase::CalculateOptimalROI::calcOptimalROI(), createTransform(), OverviewOutlinesTool::DrawRect(), HuginBase::estimateOutputROI(), HuginBase::PanoramaOptions::getVFOV(), main(), LensCalImageCtrl::OnMouseEvent(), ImageVariableDialog::OnShowDistortionGraph(), OutputProjectionInfo::OutputProjectionInfo(), PanoDetector::RemapBackKeypoints(), HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::setPanoImage(), TexCoordRemapper::UpdateAndResetIndex(), ChoosyRemapper::UpdateAndResetIndex(), and PreviewLayoutLinesTool::updateLineInformation().

bool HuginBase::PTools::Transform::emitGLSL ( std::ostringstream &  oss  )  const

Definition at line 461 of file PanoToolsTransformGPU.cpp.

References deregister_glsl(), erect_albersequalareaconic_glsl(), erect_arch_glsl(), erect_hammer_glsl(), erect_lambert_glsl(), erect_lambertazimuthal_glsl(), HuginBase::Nona::erect_mercator(), erect_mercator_glsl(), erect_millercylindrical_glsl(), HuginBase::Nona::erect_pano(), erect_pano_glsl(), HuginBase::Nona::erect_rect(), erect_rect_glsl(), HuginBase::Nona::erect_sinusoidal(), erect_sinusoidal_glsl(), HuginBase::Nona::erect_sphere_tp(), erect_sphere_tp_glsl(), HuginBase::Nona::erect_stereographic(), erect_stereographic_glsl(), HuginBase::Nona::erect_transmercator(), erect_transmercator_glsl(), HuginBase::Nona::horiz(), horiz_glsl(), lambertazimuthal_erect_glsl(), m_destTX, m_destTY, m_srcTX, m_srcTY, m_stack, orthographic_sphere_tp_glsl(), HuginBase::Nona::pano_sphere_tp(), pano_sphere_tp_glsl(), HuginBase::Nona::persp_sphere(), persp_sphere_glsl(), plane_transfer_to_camera_glsl(), HuginBase::Nona::radial(), radial_glsl(), HuginBase::Nona::rect_sphere_tp(), rect_sphere_tp_glsl(), HuginBase::Nona::resize(), resize_glsl(), HuginBase::Nona::rotate_erect(), rotate_erect_glsl(), shear_glsl(), sphere_tp_equisolid_glsl(), HuginBase::Nona::sphere_tp_erect(), sphere_tp_erect_glsl(), sphere_tp_orthographic_glsl(), sphere_tp_thoby_glsl(), HuginBase::Nona::stereographic_erect(), stereographic_erect_glsl(), thoby_sphere_tp_glsl(), HuginBase::Nona::vert(), vert_glsl(), and vertical_glsl().

Transform& HuginBase::PTools::Transform::operator= ( const Transform  )  [private]

bool HuginBase::PTools::Transform::transform ( hugin_utils::FDiff2D dest,
const hugin_utils::FDiff2D src 
) const

Definition at line 246 of file PanoToolsInterface.cpp.

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

bool HuginBase::PTools::Transform::transform ( double &  x_dest,
double &  y_dest,
double  x_src,
double  y_src 
) const

excecute transform

Definition at line 238 of file PanoToolsInterface.cpp.

References m_stack.

Referenced by HuginBase::CalculateOptimalScale::calcOptimalPanoScale(), HuginBase::CalculateFitPanorama::fitPano(), HuginBase::PanoramaOptions::getVFOV(), and HuginBase::PanoramaOptions::setVFOV().

bool HuginBase::PTools::Transform::transformImgCoord ( hugin_utils::FDiff2D dest,
const hugin_utils::FDiff2D src 
) const [inline]

Definition at line 219 of file PanoToolsInterface.h.

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

bool HuginBase::PTools::Transform::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 259 of file PanoToolsInterface.cpp.

References m_destTX, m_destTY, m_srcTX, m_srcTY, and m_stack.

Referenced by PreviewControlPointTool::AfterDrawImagesEvent(), HuginBase::PTOptEstimator::agree(), OutputProjectionInfo::AngularToImage(), HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::calcAlpha(), HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::calcSrcCoordImgs(), LensCalImageCtrl::DrawView(), OutputProjectionInfo::GetLowerX(), OutputProjectionInfo::GetUpperX(), OutputProjectionInfo::GetXAdd360(), GreatCircleArc::GreatCircleArc(), OutputProjectionInfo::ImageToAngular(), main(), LensCalImageCtrl::OnMouseEvent(), ImageVariableDialog::OnShowDistortionGraph(), OutputProjectionInfo::OutputProjectionInfo(), PanoDetector::RemapBackKeypoints(), OverviewOutlinesTool::Rect::transformImgCoord(), HuginBase::MaskPolygon::transformPolygon(), TexCoordRemapper::UpdateAndResetIndex(), LayoutRemapper::UpdateAndResetIndex(), ChoosyRemapper::UpdateAndResetIndex(), PreviewLayoutLinesTool::updateImageCentres(), PreviewLayoutLinesTool::updateLineInformation(), and work_on_triplets().

bool HuginBase::PTools::Transform::transformImgCoordPartial ( double &  x_dest,
double &  y_dest,
double  x_src,
double  y_src 
) const

Definition at line 519 of file PanoToolsTransformGPU.cpp.

References m_srcTX, m_srcTY, and m_stack.

void HuginBase::PTools::Transform::updatePTData ( const vigra::Diff2D &  srcSize,
const VariableMap srcVars,
Lens::LensProjectionFormat srcProj,
const vigra::Diff2D &  destSize,
PanoramaOptions::ProjectionFormat destProj,
const std::vector< double > &  destProjParam,
double  destHFOV 
) [private]

Definition at line 50 of file PanoToolsInterface.cpp.

References HuginBase::PTools::freeImage(), m_dstImage, m_initialized, m_srcImage, HuginBase::PTools::setDestImage(), and HuginBase::PTools::setFullImage().

Referenced by createInvTransform(), and createTransform().


Member Data Documentation

double HuginBase::PTools::Transform::m_destTX [private]

Definition at line 246 of file PanoToolsInterface.h.

Referenced by createInvTransform(), createTransform(), emitGLSL(), and transformImgCoord().

double HuginBase::PTools::Transform::m_destTY [private]

Definition at line 246 of file PanoToolsInterface.h.

Referenced by createInvTransform(), createTransform(), emitGLSL(), and transformImgCoord().

Image HuginBase::PTools::Transform::m_dstImage [private]

Definition at line 240 of file PanoToolsInterface.h.

Referenced by createInvTransform(), createTransform(), updatePTData(), and ~Transform().

bool HuginBase::PTools::Transform::m_initialized [private]

Definition at line 237 of file PanoToolsInterface.h.

Referenced by updatePTData(), and ~Transform().

struct MakeParams HuginBase::PTools::Transform::m_mp [private]

Definition at line 241 of file PanoToolsInterface.h.

Referenced by createInvTransform(), and createTransform().

Image HuginBase::PTools::Transform::m_srcImage [private]

Definition at line 239 of file PanoToolsInterface.h.

Referenced by createInvTransform(), createTransform(), updatePTData(), and ~Transform().

double HuginBase::PTools::Transform::m_srcTX [private]

Definition at line 245 of file PanoToolsInterface.h.

Referenced by createInvTransform(), createTransform(), emitGLSL(), transformImgCoord(), and transformImgCoordPartial().

double HuginBase::PTools::Transform::m_srcTY [private]

Definition at line 245 of file PanoToolsInterface.h.

Referenced by createInvTransform(), createTransform(), emitGLSL(), transformImgCoord(), and transformImgCoordPartial().

struct fDesc HuginBase::PTools::Transform::m_stack[15] [private]

Definition at line 242 of file PanoToolsInterface.h.

Referenced by createInvTransform(), createTransform(), emitGLSL(), transform(), transformImgCoord(), and transformImgCoordPartial().


The documentation for this class was generated from the following files:
Generated on 21 Oct 2014 for Hugintrunk by  doxygen 1.4.7