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, 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(), HuginBase::PanoramaOptions::getSize(), and HuginBase::VariableMap.

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(), PreviewControlPointTool::MakeTransforms(), 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(), HuginBase::PanoramaOptions::getSize(), and HuginBase::VariableMap.

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 HuginLines::_getVerticalLines(), HuginBase::PTOptEstimator::agree(), PreviewColorPickerTool::CalcCorrection(), 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(), PlaneOverviewToolHelper::UpdateImagesUnderMouse(), PanosphereOverviewToolHelper::UpdateImagesUnderMouse(), PreviewToolHelper::UpdateImagesUnderMouse(), PreviewLayoutLinesTool::updateLineInformation(), and work_on_triplets().

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(), erect_mercator_glsl(), erect_millercylindrical_glsl(), erect_pano_glsl(), erect_rect_glsl(), erect_sinusoidal_glsl(), erect_sphere_tp_glsl(), erect_stereographic_glsl(), erect_transmercator_glsl(), horiz_glsl(), lambertazimuthal_erect_glsl(), m_destTX, m_destTY, m_srcTX, m_srcTY, orthographic_sphere_tp_glsl(), pano_sphere_tp_glsl(), persp_sphere_glsl(), plane_transfer_to_camera_glsl(), radial_glsl(), rect_sphere_tp_glsl(), resize_glsl(), rotate_erect_glsl(), shear_glsl(), sphere_tp_equisolid_glsl(), sphere_tp_erect_glsl(), sphere_tp_orthographic_glsl(), sphere_tp_thoby_glsl(), stereographic_erect_glsl(), thoby_sphere_tp_glsl(), 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 hugin_utils::FDiff2D, 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.

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::FDiff2D, 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, and m_srcTY.

Referenced by HuginLines::_getVerticalLines(), PreviewControlPointTool::AfterDrawImagesEvent(), HuginBase::PTOptEstimator::agree(), OutputProjectionInfo::AngularToImage(), HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::calcAlpha(), PreviewColorPickerTool::CalcCorrection(), 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(), PlaneOverviewToolHelper::UpdateImagesUnderMouse(), PanosphereOverviewToolHelper::UpdateImagesUnderMouse(), PreviewToolHelper::UpdateImagesUnderMouse(), 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_destTX, m_destTY, m_srcTX, and m_srcTY.

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_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(), transformImgCoord(), and transformImgCoordPartial().

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

Definition at line 246 of file PanoToolsInterface.h.

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

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.

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(), and createTransform().


The documentation for this class was generated from the following files:
Generated on Mon Sep 22 01:25:58 2014 for Hugintrunk by  doxygen 1.3.9.1