Hugintrunk
0.1
|
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 &) | |
Transform & | operator= (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 |
Holds transformations for Image -> Pano and the other way.
Definition at line 105 of file PanoToolsInterface.h.
|
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.
|
private |
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
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 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) |
||
) |
create image->pano transformation
Definition at line 188 of file PanoToolsInterface.cpp.
References createInvTransform(), HuginBase::SrcPanoImage::getHeight(), HuginBase::PanoramaOptions::getHeight(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::PanoramaData::getImage(), HuginBase::PanoramaData::getImageVariables(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getProjectionParameters(), HuginBase::SrcPanoImage::getWidth(), and HuginBase::PanoramaOptions::getWidth().
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::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:
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) |
||
) |
create pano -> img transform
Definition at line 70 of file PanoToolsInterface.cpp.
References createTransform(), HuginBase::SrcPanoImage::getHeight(), HuginBase::PanoramaOptions::getHeight(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::PanoramaData::getImage(), HuginBase::PanoramaData::getImageVariables(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getProjectionParameters(), HuginBase::SrcPanoImage::getWidth(), and HuginBase::PanoramaOptions::getWidth().
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().
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().
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(), wxGraphTools::GetDistortionGraph(), HuginBase::PanoramaOptions::getVFOV(), PreviewPanel::mouse2erect(), and HuginBase::PanoramaOptions::setVFOV().
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::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().
|
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::transformImgCoordPartial | ( | double & | x_dest, |
double & | y_dest, | ||
double | x_src, | ||
double | y_src | ||
) | const |
|
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().
|
private |
Definition at line 246 of file PanoToolsInterface.h.
Referenced by createInvTransform(), createTransform(), emitGLSL(), transformImgCoord(), and transformImgCoordPartial().
|
private |
Definition at line 246 of file PanoToolsInterface.h.
Referenced by createInvTransform(), createTransform(), emitGLSL(), transformImgCoord(), and transformImgCoordPartial().
|
private |
Definition at line 240 of file PanoToolsInterface.h.
Referenced by createInvTransform(), createTransform(), updatePTData(), and ~Transform().
|
private |
Definition at line 237 of file PanoToolsInterface.h.
Referenced by updatePTData(), and ~Transform().
|
private |
Definition at line 241 of file PanoToolsInterface.h.
Referenced by createInvTransform(), and createTransform().
|
private |
Definition at line 239 of file PanoToolsInterface.h.
Referenced by createInvTransform(), createTransform(), updatePTData(), and ~Transform().
|
private |
Definition at line 245 of file PanoToolsInterface.h.
Referenced by createInvTransform(), createTransform(), emitGLSL(), transformImgCoord(), and transformImgCoordPartial().
|
private |
Definition at line 245 of file PanoToolsInterface.h.
Referenced by createInvTransform(), createTransform(), emitGLSL(), transformImgCoord(), and transformImgCoordPartial().
|
private |
Definition at line 242 of file PanoToolsInterface.h.
Referenced by createInvTransform(), createTransform(), emitGLSL(), transform(), transformImgCoord(), and transformImgCoordPartial().