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::PTools::Transform Class Reference

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

#include <PanoToolsInterface.h>

Public Member Functions

 Transform ()
 construct a new Transform object, without initializing a transformation More...
 
 ~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 More...
 
void createTransform (const PanoramaData &pano, unsigned int imgNr, const PanoramaOptions &dest, vigra::Diff2D srcSize=vigra::Diff2D(0, 0))
 create pano -> img transform More...
 
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 More...
 
void createInvTransform (const PanoramaData &pano, unsigned int imgNr, const PanoramaOptions &dest, vigra::Diff2D srcSize=vigra::Diff2D(0, 0))
 create image->pano transformation More...
 
void createInvTransform (const SrcPanoImage &src, const PanoramaOptions &dest)
 create image->pano transformation More...
 
bool transform (double &x_dest, double &y_dest, double x_src, double y_src) const
 excecute transform More...
 
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 More...
 
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
 
struct MakeParams m_mp
 
struct 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 ( )
HuginBase::PTools::Transform::Transform ( const Transform )
private

Member Function Documentation

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
srcSizesize of input image
variablesof input image
srcProjprojection of the image
destSizeoutput panorama size
destProjpanorama projection
destHFOVHFOV of panorama
origSrcSizeoriginal 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 PreviewIdentifyTool::AfterDrawImagesEvent(), HuginBase::PTOptEstimator::agree(), createInvTransform(), LensCalImageCtrl::DrawView(), CPEditorPanel::EstimatePoint(), PreviewEditCPTool::FindCPInRect(), HuginBase::CalculateFitPanorama::fitPano(), GetImageRotatedTo(), GreatCircleArc::GreatCircleArc(), main(), PreviewControlPointTool::MakeTransforms(), OutputProjectionInfo::OutputProjectionInfo(), PointFineTuneProjectionAware(), PanoCommand::wxAddCtrlPointGridCmd::processPanorama(), HuginBase::PanoramaOptions::setVFOV(), HuginBase::Panorama::transferMask(), LayoutRemapper::UpdateAndResetIndex(), VertexCoordRemapper::UpdateAndResetIndex(), PreviewLayoutLinesTool::updateImageCentres(), CPEditorPanel::UpdateTransforms(), and work_on_triplets().

void HuginBase::PTools::Transform::createInvTransform ( const PanoramaData pano,
unsigned int  imgNr,
const PanoramaOptions dest,
vigra::Diff2D  srcSize = vigra::Diff2D(0,0) 
)
void HuginBase::PTools::Transform::createInvTransform ( const SrcPanoImage src,
const PanoramaOptions dest 
)
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

Todo:
The next few functions could be rewritten to make more effective use of SrcPanoImages.

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(), AddGeometricControlPoint(), PreviewEditCPTool::AddLineCP(), HuginBase::PTOptEstimator::agree(), PreviewColorPickerTool::CalcCorrection(), HuginBase::CalculateOptimalScale::calcOptimalPanoScale(), HuginBase::CalculateOptimalROI::calcOptimalROI(), createTransform(), OverviewOutlinesTool::DrawRect(), HuginBase::estimateOutputROI(), CPEditorPanel::EstimatePoint(), wxGraphTools::GetDistortionGraph(), ToolHelper::GetImagesUnderPos(), HuginBase::PanoramaOptions::getVFOV(), main(), GLPreviewFrame::OnCreateCP(), LensCalImageCtrl::OnMouseEvent(), OutputProjectionInfo::OutputProjectionInfo(), PointFineTuneProjectionAware(), PanoCommand::wxAddCtrlPointGridCmd::processPanorama(), PanoDetector::RemapBackKeypoints(), RemapImage(), HuginBase::AllPointSampler::sampleAllPanoPoints(), HuginBase::RandomPointSampler::sampleRandomPanoPoints(), HuginBase::Panorama::transferMask(), ChoosyRemapper::UpdateAndResetIndex(), TexCoordRemapper::UpdateAndResetIndex(), PreviewLayoutLinesTool::updateLineInformation(), PreviewPanel::updatePreview(), CPEditorPanel::UpdateTransforms(), and work_on_triplets().

void HuginBase::PTools::Transform::createTransform ( const PanoramaData pano,
unsigned int  imgNr,
const PanoramaOptions dest,
vigra::Diff2D  srcSize = vigra::Diff2D(0,0) 
)
void HuginBase::PTools::Transform::createTransform ( const SrcPanoImage src,
const PanoramaOptions dest 
)
bool HuginBase::PTools::Transform::emitGLSL ( std::ostringstream &  oss) const
Transform& HuginBase::PTools::Transform::operator= ( const Transform )
private
bool HuginBase::PTools::Transform::transform ( double &  x_dest,
double &  y_dest,
double  x_src,
double  y_src 
) const
bool HuginBase::PTools::Transform::transform ( hugin_utils::FDiff2D dest,
const hugin_utils::FDiff2D src 
) const
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 HuginLines::_getVerticalLines(), PreviewEditCPTool::AddLineCP(), PreviewControlPointTool::AfterDrawImagesEvent(), PreviewIdentifyTool::AfterDrawImagesEvent(), HuginBase::PTOptEstimator::agree(), OutputProjectionInfo::AngularToImage(), PreviewColorPickerTool::CalcCorrection(), CheckAndAddPoint(), DisplayedControlPoint::DrawLine(), DisplayedControlPoint::DrawLineSegment(), LensCalImageCtrl::DrawView(), CPEditorPanel::EstimatePoint(), GetImageRotatedTo(), ToolHelper::GetImagesUnderPos(), OutputProjectionInfo::GetLowerX(), CPImageCtrl::GetMagBitmap(), OutputProjectionInfo::GetUpperX(), OutputProjectionInfo::GetXAdd360(), GreatCircleArc::GreatCircleArc(), OutputProjectionInfo::ImageToAngular(), main(), GLPreviewFrame::OnCreateCP(), LensCalImageCtrl::OnMouseEvent(), OutputProjectionInfo::OutputProjectionInfo(), PointFineTuneProjectionAware(), PanoCommand::wxAddCtrlPointGridCmd::processPanorama(), VertexCoordRemapper::RecursiveUpdate(), PanoDetector::RemapBackKeypoints(), OverviewOutlinesTool::Rect::transformImgCoord(), HuginBase::MaskPolygon::transformPolygon(), ChoosyRemapper::UpdateAndResetIndex(), LayoutRemapper::UpdateAndResetIndex(), TexCoordRemapper::UpdateAndResetIndex(), PreviewLayoutLinesTool::updateImageCentres(), PreviewLayoutLinesTool::updateLineInformation(), and work_on_triplets().

bool HuginBase::PTools::Transform::transformImgCoord ( hugin_utils::FDiff2D dest,
const hugin_utils::FDiff2D src 
) const
inline
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, 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

Member Data Documentation

double HuginBase::PTools::Transform::m_destTX
private
double HuginBase::PTools::Transform::m_destTY
private
Image HuginBase::PTools::Transform::m_dstImage
private
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
double HuginBase::PTools::Transform::m_srcTX
private
double HuginBase::PTools::Transform::m_srcTY
private
struct fDesc HuginBase::PTools::Transform::m_stack[15]
private

The documentation for this class was generated from the following files: