HuginBase::SrcPanoImage Class Reference

All variables of a source image. More...

#include <SrcPanoImage.h>

Inheritance diagram for HuginBase::SrcPanoImage:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 SrcPanoImage ()
virtual ~SrcPanoImage ()
void resize (const vigra::Size2D &size)
 "resize" image, adjusts all distortion coefficients for usage with a source image of size size
bool isInside (vigra::Point2D p, bool ignoreMasks=false) const
 check if a coordinate is inside the source image
bool horizontalWarpNeeded ()
bool getCorrectTCA () const
void setCropMode (CropMode val)
 Set the crop mode.
bool isCircularCrop () const
 returns true, if projection requires cicular crop
void setSize (vigra::Size2D val)
 Set the image size in pixels.
hugin_utils::FDiff2D getRadialDistortionCenter () const
hugin_utils::FDiff2D getRadialVigCorrCenter () const
double getExposure () const
void setExposure (const double &val)
int getWidth () const
 Get the width of the image in pixels.
int getHeight () const
 Get the height of the image in pixels.
double getVar (const std::string &name) const
void setVar (const std::string &name, double val)
VariableMap getVariableMap () const
 Return all the image variables in a variable map.
const int getExifDateTime (struct tm *datetime) const
 try to convert Exif date time string to struct tm
void unlinkRadialVigCorrCoeff ()
 unlinking vignetting parameters should unlink the vignetting correction mode
void unlinkRadialVigCorrCenterShift ()
 unlinking vignetting parameters should unlink the vignetting correction mode
void unlinkEMoRParams ()
 unlinking the EMOR parameters should unlink the correction mode.
void linkRadialVigCorrCoeff (SrcPanoImage *target)
 linking vignetting parameters should link the vignetting correction mode
void linkRadialVigCorrCenterShift (SrcPanoImage *target)
 linking vignetting parameters should link the vignetting correction mode
void linkEMoRParams (SrcPanoImage *target)
 linking the EMOR parameters should link the correction mode.
void linkStack (SrcPanoImage *target)
bool checkImageSizeKnown ()
 check if the image size is known, if try to load the information from the file
bool readEXIF ()
 try to fill out information about the image, by examining the exif data
bool applyEXIFValues (bool applyEVValue=true)
 apply values found in EXIF data to SrcPanoImage class, call readEXIF() before to initialize some values
double calcExifExposureValue ()
 calculate exposure value
void updateFocalLength (double newFocalLength)
 updates the focal length, changes the hfov to reflect thew newFocalLength
void updateCropFactor (double focalLength, double newCropFactor)
 updates the crop factor, the hfov is calculates so that focal length remains the same
bool readCropfactorFromDB ()
 tries to read cropfactor from lens database you need to call SrcPanoImage::readEXIF before to fill some values
bool readProjectionFromDB ()
 tries to read projection and crop area from lens database you need to call SrcPanoImage::readEXIF before to fill some values
bool readDistortionFromDB ()
 tries to read distortion data from lens database you need to call SrcPanoImage::readEXIF before to fill some values
bool readVignettingFromDB ()
 tries to read vignetting data from lens database you need to call SrcPanoImage::readEXIF before to fill some values
std::string getDBLensName () const
 constructs the lens name for the database it is the lensname if known, for compact cameras it is constructed from camera maker and camera model
bool hasMasks () const
 returns true, if image has masks associated
bool hasPositiveMasks () const
 returns true, if image has positive masks
bool hasActiveMasks () const
 returns true, if image has active masks
void addMask (MaskPolygon newMask)
 add newMask to list of masks
void addActiveMask (MaskPolygon newMask)
 add newMask to list of active masks
void clearActiveMasks ()
 clears list of active masks
void changeMaskType (unsigned int index, HuginBase::MaskPolygon::MaskType newType)
 changes type of mask with index to given newType
void deleteMask (unsigned int index)
 delete mask at index
void deleteAllMasks ()
 delete all masks
void printMaskLines (std::ostream &o, unsigned int newImgNr) const
 writes all mask lines to stream, using given image number
bool isInsideMasks (vigra::Point2D p) const
 returns true, if point p is inside of one mask polygon

Static Public Member Functions

static double calcHFOV (SrcPanoImage::Projection proj, double fl, double crop, vigra::Size2D imageSize)
 calculate hfov of an image given focal length, image size and crop factor
static double calcFocalLength (SrcPanoImage::Projection proj, double hfov, double crop, vigra::Size2D imageSize)
 calcualte focal length, given crop factor and hfov
static double calcCropFactor (SrcPanoImage::Projection proj, double hfov, double focalLength, vigra::Size2D imageSize)
 calculate crop factor, given focal length and hfov

Private Member Functions

bool trustExivOrientation ()
 Decides if the Exiv Orientation Tag of an images is plausible.

Detailed Description

All variables of a source image.

In the long term, this simplified class will replace PanoImage and Image options and the variables array. All image variables are stored in this class, regardless of what the variable is attached to (lens, sensor, position).

Definition at line 1487 of file SrcPanoImage.h.


Constructor & Destructor Documentation

HuginBase::SrcPanoImage::SrcPanoImage (  )  [inline]

Definition at line 1491 of file SrcPanoImage.h.

virtual HuginBase::SrcPanoImage::~SrcPanoImage (  )  [inline, virtual]

Definition at line 1496 of file SrcPanoImage.h.


Member Function Documentation

void HuginBase::SrcPanoImage::addActiveMask ( MaskPolygon  newMask  ) 

add newMask to list of active masks

Definition at line 1715 of file SrcPanoImage.cpp.

void HuginBase::SrcPanoImage::addMask ( MaskPolygon  newMask  ) 

add newMask to list of masks

Definition at line 1708 of file SrcPanoImage.cpp.

bool HuginBase::SrcPanoImage::applyEXIFValues ( bool  applyEVValue = true  ) 

apply values found in EXIF data to SrcPanoImage class, call readEXIF() before to initialize some values

Definition at line 1359 of file SrcPanoImage.cpp.

Referenced by main2(), PanoCommand::wxLoadPTProjectCmd::processPanorama(), PanoCommand::wxAddImagesCmd::processPanorama(), and FindPanoDialog::SearchInDir().

double HuginBase::SrcPanoImage::calcCropFactor ( SrcPanoImage::Projection  proj,
double  hfov,
double  focalLength,
vigra::Size2D  imageSize 
) [static]

calculate crop factor, given focal length and hfov

Definition at line 1633 of file SrcPanoImage.cpp.

Referenced by PT::calcCropFactor().

double HuginBase::SrcPanoImage::calcExifExposureValue (  ) 

calculate exposure value

Definition at line 1666 of file SrcPanoImage.cpp.

Referenced by PanoOperation::ResetOperation::GetInternalCommand(), and main2().

double HuginBase::SrcPanoImage::calcFocalLength ( SrcPanoImage::Projection  proj,
double  hfov,
double  crop,
vigra::Size2D  imageSize 
) [static]

calcualte focal length, given crop factor and hfov

Definition at line 1588 of file SrcPanoImage.cpp.

Referenced by HuginLines::_getVerticalLines(), ApplyLensDBParameters(), PT::calcFocalLength(), HFOVDialog::OnHFOVChanged(), ImagesPanel::OnLensTypeChanged(), GLPreviewFrame::OnLensTypeChanged(), HFOVDialog::OnLoadLensParameters(), ImagesPanel::OnSelectionChanged(), GLPreviewFrame::panoramaChanged(), and SaveLensParameters().

double HuginBase::SrcPanoImage::calcHFOV ( SrcPanoImage::Projection  proj,
double  fl,
double  crop,
vigra::Size2D  imageSize 
) [static]

calculate hfov of an image given focal length, image size and crop factor

Definition at line 1537 of file SrcPanoImage.cpp.

Referenced by ApplyLensDBParameters(), PT::calcHFOV(), EVT_BUTTON(), LensCalImageCtrl::GenerateRemappedImage(), PanoOperation::ResetOperation::GetInternalCommand(), LensCalFrame::GetPanorama(), HFOVDialog::OnCropFactorChanged(), ImagesPanel::OnFocalLengthChanged(), HFOVDialog::OnFocalLengthChanged(), HFOVDialog::OnTypeChanged(), and SaveLensParameters().

void HuginBase::SrcPanoImage::changeMaskType ( unsigned int  index,
HuginBase::MaskPolygon::MaskType  newType 
)

changes type of mask with index to given newType

Definition at line 1761 of file SrcPanoImage.cpp.

bool HuginBase::SrcPanoImage::checkImageSizeKnown (  ) 

check if the image size is known, if try to load the information from the file

Definition at line 1088 of file SrcPanoImage.cpp.

void HuginBase::SrcPanoImage::clearActiveMasks (  ) 

clears list of active masks

Definition at line 1722 of file SrcPanoImage.cpp.

void HuginBase::SrcPanoImage::deleteAllMasks (  ) 

delete all masks

Definition at line 1781 of file SrcPanoImage.cpp.

Referenced by HuginLines::_getVerticalLines(), PT::wxAddImagesCmd::processPanorama(), and PanoCommand::wxAddImagesCmd::processPanorama().

void HuginBase::SrcPanoImage::deleteMask ( unsigned int  index  ) 

delete mask at index

Definition at line 1771 of file SrcPanoImage.cpp.

bool HuginBase::SrcPanoImage::getCorrectTCA (  )  const

Definition at line 339 of file SrcPanoImage.cpp.

Referenced by correctImage(), HuginBase::Nona::estScaleFactorForFullFrame(), HuginBase::Nona::SpaceTransform::InitInvRadialCorrect(), and HuginBase::Nona::SpaceTransform::InitRadialCorrect().

std::string HuginBase::SrcPanoImage::getDBLensName (  )  const

constructs the lens name for the database it is the lensname if known, for compact cameras it is constructed from camera maker and camera model

Definition at line 1441 of file SrcPanoImage.cpp.

Referenced by ApplyLensDBParameters(), main(), print_result(), and SaveLensParameters().

const int HuginBase::SrcPanoImage::getExifDateTime ( struct tm *  datetime  )  const

try to convert Exif date time string to struct tm

Returns:
0, if conversion was sucessfull

Definition at line 1815 of file SrcPanoImage.cpp.

Referenced by FillPlaceholders(), PossiblePano::GetDateTime(), and ImagesTreeCtrl::UpdateImageText().

double HuginBase::SrcPanoImage::getExposure (  )  const

Definition at line 376 of file SrcPanoImage.cpp.

Referenced by PreviewDifferenceTool::AfterDrawImagesEvent(), TextureManager::DrawImage(), HuginBase::Photometric::ResponseTransform< VTIn >::initWithSrcImg(), and TextureManager::TextureKey::SetOptions().

int HuginBase::SrcPanoImage::getHeight (  )  const [inline]

Get the height of the image in pixels.

Should not be used, use getSize().height() instead. This is here for compatiblity with PnaoImage, but should be removed.

Todo:
replace all calls to getHeight() with getSize().height().

Definition at line 1561 of file SrcPanoImage.h.

Referenced by HuginBase::PTools::Transform::createInvTransform(), HuginBase::PTools::Transform::createTransform(), TextureManager::TextureInfo::DefineMaskTexture(), HuginQueue::detail::PrintDetailInfo(), PT::wxAddCtrlPointGridCmd::processPanorama(), and PanoCommand::wxAddCtrlPointGridCmd::processPanorama().

hugin_utils::FDiff2D HuginBase::SrcPanoImage::getRadialDistortionCenter (  )  const

Definition at line 349 of file SrcPanoImage.cpp.

References cerr.

Referenced by MaskEditorPanel::setImage().

hugin_utils::FDiff2D HuginBase::SrcPanoImage::getRadialVigCorrCenter (  )  const

Definition at line 355 of file SrcPanoImage.cpp.

Referenced by HuginBase::Photometric::InvResponseTransform< VTIn, VTOut >::emitGLSL(), HuginBase::Photometric::ResponseTransform< VTIn >::initWithSrcImg(), HuginBase::AllPointSampler::sampleAllPanoPoints(), and HuginBase::RandomPointSampler::sampleRandomPanoPoints().

double HuginBase::SrcPanoImage::getVar ( const std::string name  )  const

Referenced by HuginBase::OptVarSpec::get(), and LensCalFrame::Optimize().

VariableMap HuginBase::SrcPanoImage::getVariableMap (  )  const

Return all the image variables in a variable map.

Returns a map of all the variables for this image. It is adivisable to use the individual getX functions where apropriate instead.

Todo:
remove this infavour of the individual get*() functions. This creates a map of all the variables, regardless of which ones are actually needed, every time it is called.

int HuginBase::SrcPanoImage::getWidth (  )  const [inline]

Get the width of the image in pixels.

Should not be used, use getSize().width() instead. This is here for compatiblity with PnaoImage, but should be removed.

Todo:
replace all calls to getWidth() with getSize().width().

Definition at line 1551 of file SrcPanoImage.h.

Referenced by HuginBase::PTools::Transform::createInvTransform(), HuginBase::PTools::Transform::createTransform(), TextureManager::TextureInfo::DefineMaskTexture(), CPEditorPanel::estimateAndAddOtherPoint(), CPEditorPanel::NewPointChange(), HuginQueue::detail::PrintDetailInfo(), PT::wxAddCtrlPointGridCmd::processPanorama(), and PanoCommand::wxAddCtrlPointGridCmd::processPanorama().

bool HuginBase::SrcPanoImage::hasActiveMasks (  )  const

returns true, if image has active masks

Definition at line 1749 of file SrcPanoImage.cpp.

Referenced by TextureManager::TextureInfo::DefineMaskTexture(), HuginBase::estimateImageAlpha(), and HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::remapImage().

bool HuginBase::SrcPanoImage::hasMasks (  )  const

returns true, if image has masks associated

Definition at line 1728 of file SrcPanoImage.cpp.

Referenced by ImagesListMask::UpdateItem().

bool HuginBase::SrcPanoImage::hasPositiveMasks (  )  const

returns true, if image has positive masks

Definition at line 1733 of file SrcPanoImage.cpp.

bool HuginBase::SrcPanoImage::horizontalWarpNeeded (  ) 

Definition at line 106 of file SrcPanoImage.cpp.

References HuginBase::BaseSrcPanoImage::CIRCULAR_FISHEYE, HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR, HuginBase::BaseSrcPanoImage::FISHEYE_EQUISOLID, HuginBase::BaseSrcPanoImage::FISHEYE_ORTHOGRAPHIC, HuginBase::BaseSrcPanoImage::FISHEYE_STEREOGRAPHIC, HuginBase::BaseSrcPanoImage::FISHEYE_THOBY, HuginBase::BaseSrcPanoImage::FULL_FRAME_FISHEYE, HuginBase::ImageVariable< Type >::getData(), HuginBase::BaseSrcPanoImage::m_HFOV, HuginBase::BaseSrcPanoImage::m_Projection, HuginBase::BaseSrcPanoImage::PANORAMIC, and HuginBase::BaseSrcPanoImage::RECTILINEAR.

Referenced by HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::remapImage().

bool HuginBase::SrcPanoImage::isCircularCrop (  )  const

returns true, if projection requires cicular crop

Definition at line 333 of file SrcPanoImage.cpp.

Referenced by ApplyLensDBParameters(), HFOVDialog::OnLoadLensParameters(), and MaskEditorPanel::setImage().

bool HuginBase::SrcPanoImage::isInside ( vigra::Point2D  p,
bool  ignoreMasks = false 
) const

check if a coordinate is inside the source image

Definition at line 304 of file SrcPanoImage.cpp.

Referenced by applyMaskAndCrop(), HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::calcAlpha(), HuginBase::CalculateImageOverlap::calculate(), HuginBase::getCPinMasks(), VertexCoordRemapper::GetNextFaceCoordinates(), TexCoordRemapper::GetNextFaceCoordinates(), HuginBase::AllPointSampler::sampleAllPanoPoints(), HuginBase::RandomPointSampler::sampleRandomPanoPoints(), HuginBase::CalculateOptimalROI::stackPixel(), PlaneOverviewToolHelper::UpdateImagesUnderMouse(), PanosphereOverviewToolHelper::UpdateImagesUnderMouse(), PreviewToolHelper::UpdateImagesUnderMouse(), and PreviewLayoutLinesTool::updateLineInformation().

bool HuginBase::SrcPanoImage::isInsideMasks ( vigra::Point2D  p  )  const

returns true, if point p is inside of one mask polygon

Definition at line 1787 of file SrcPanoImage.cpp.

Referenced by HuginBase::estimateImageAlpha().

void HuginBase::SrcPanoImage::linkEMoRParams ( SrcPanoImage target  )  [inline]

linking the EMOR parameters should link the correction mode.

Definition at line 1625 of file SrcPanoImage.h.

void HuginBase::SrcPanoImage::linkRadialVigCorrCenterShift ( SrcPanoImage target  )  [inline]

linking vignetting parameters should link the vignetting correction mode

Definition at line 1617 of file SrcPanoImage.h.

void HuginBase::SrcPanoImage::linkRadialVigCorrCoeff ( SrcPanoImage target  )  [inline]

linking vignetting parameters should link the vignetting correction mode

Definition at line 1609 of file SrcPanoImage.h.

void HuginBase::SrcPanoImage::linkStack ( SrcPanoImage target  )  [inline]

Definition at line 1631 of file SrcPanoImage.h.

void HuginBase::SrcPanoImage::printMaskLines ( std::ostream o,
unsigned int  newImgNr 
) const

writes all mask lines to stream, using given image number

Definition at line 1754 of file SrcPanoImage.cpp.

Referenced by TextureManager::TextureKey::SetOptions().

bool HuginBase::SrcPanoImage::readCropfactorFromDB (  ) 

tries to read cropfactor from lens database you need to call SrcPanoImage::readEXIF before to fill some values

Returns:
true, if information could be read from database

Definition at line 1418 of file SrcPanoImage.cpp.

Referenced by PT::wxAddImagesCmd::processPanorama(), and PanoCommand::wxAddImagesCmd::processPanorama().

bool HuginBase::SrcPanoImage::readDistortionFromDB (  ) 

tries to read distortion data from lens database you need to call SrcPanoImage::readEXIF before to fill some values

Returns:
true, if information could be read from database

Definition at line 1496 of file SrcPanoImage.cpp.

Referenced by main(), main2(), and FindPanoDialog::SearchInDir().

bool HuginBase::SrcPanoImage::readEXIF (  ) 

try to fill out information about the image, by examining the exif data

Definition at line 1111 of file SrcPanoImage.cpp.

Referenced by HuginBase::StraightenPanorama::calcStraighteningRotation(), PT::initImageFromFile(), main(), main2(), print_result(), PT::wxLoadPTProjectCmd::processPanorama(), PT::wxAddImagesCmd::processPanorama(), PanoCommand::wxLoadPTProjectCmd::processPanorama(), PanoCommand::wxAddImagesCmd::processPanorama(), and FindPanoDialog::SearchInDir().

bool HuginBase::SrcPanoImage::readProjectionFromDB (  ) 

tries to read projection and crop area from lens database you need to call SrcPanoImage::readEXIF before to fill some values

Returns:
true, if information could be read from database

Definition at line 1461 of file SrcPanoImage.cpp.

Referenced by PT::wxAddImagesCmd::processPanorama(), PanoCommand::wxAddImagesCmd::processPanorama(), and FindPanoDialog::SearchInDir().

bool HuginBase::SrcPanoImage::readVignettingFromDB (  ) 

tries to read vignetting data from lens database you need to call SrcPanoImage::readEXIF before to fill some values

Returns:
true, if information could be read from database

Definition at line 1517 of file SrcPanoImage.cpp.

Referenced by main(), and FindPanoDialog::SearchInDir().

void HuginBase::SrcPanoImage::resize ( const vigra::Size2D &  size  ) 

"resize" image, adjusts all distortion coefficients for usage with a source image of size size

Definition at line 57 of file SrcPanoImage.cpp.

References HuginBase::BaseSrcPanoImage::CROP_CIRCLE, HuginBase::BaseSrcPanoImage::CROP_RECTANGLE, HuginBase::ImageVariable< Type >::getData(), HuginBase::BaseSrcPanoImage::m_ActiveMasks, HuginBase::BaseSrcPanoImage::m_CropMode, HuginBase::BaseSrcPanoImage::m_CropRect, HuginBase::BaseSrcPanoImage::m_Masks, HuginBase::BaseSrcPanoImage::m_RadialDistortionCenterShift, HuginBase::BaseSrcPanoImage::m_RadialVigCorrCenterShift, HuginBase::BaseSrcPanoImage::m_Shear, HuginBase::BaseSrcPanoImage::m_Size, HuginBase::BaseSrcPanoImage::NO_CROP, and HuginBase::ImageVariable< Type >::setData().

Referenced by HuginBase::SmallRemappedImageCache::getRemapped(), main(), PT::wxApplyTemplateCmd::processPanorama(), PT::wxLoadPTProjectCmd::processPanorama(), PanoCommand::wxApplyTemplateCmd::processPanorama(), PanoCommand::wxLoadPTProjectCmd::processPanorama(), and HuginBase::PointSampler::sampleAndExtractPoints().

void HuginBase::SrcPanoImage::setCropMode ( CropMode  val  ) 

Set the crop mode.

This sets the cropping region to the entire image when set to NO_CROP, unlike the lazy metaprogrammed equivalent in BaseSrcPanoImage.

Definition at line 360 of file SrcPanoImage.cpp.

References hugin_utils::tolower().

Referenced by HFOVDialog::OnLoadLensParameters().

void HuginBase::SrcPanoImage::setExposure ( const double &  val  ) 

Definition at line 379 of file SrcPanoImage.cpp.

void HuginBase::SrcPanoImage::setSize ( vigra::Size2D  val  ) 

Set the image size in pixels.

If we aren't cropping the image, set the size to the entire image

Reimplemented from HuginBase::BaseSrcPanoImage.

Definition at line 368 of file SrcPanoImage.cpp.

Referenced by HuginBase::Nona::SpaceTransform::createInvTransform(), PanosphereOverviewProjectionGridTool::createMesh(), PreviewProjectionGridTool::createMesh(), HuginBase::Nona::SpaceTransform::createTransform(), OverviewOutlinesTool::DrawRect(), HuginBase::CalculateFitPanorama::fitPano(), GetImageRotatedTo(), HuginBase::PanoramaOptions::getVFOV(), GreatCircleArc::GreatCircleArc(), main(), OutputProjectionInfo::OutputProjectionInfo(), processImg(), PanoCommand::wxAddImagesCmd::processPanorama(), HuginBase::PanoramaOptions::setVFOV(), and PreviewPanel::updatePreview().

void HuginBase::SrcPanoImage::setVar ( const std::string name,
double  val 
)

Referenced by HuginBase::Nona::SpaceTransform::createInvTransform(), HuginBase::Nona::SpaceTransform::createTransform(), and LensCalImageCtrl::GenerateRemappedImage().

bool HuginBase::SrcPanoImage::trustExivOrientation (  )  [private]

Decides if the Exiv Orientation Tag of an images is plausible.

Current checks:

Definition at line 1807 of file SrcPanoImage.cpp.

void HuginBase::SrcPanoImage::unlinkEMoRParams (  )  [inline]

unlinking the EMOR parameters should unlink the correction mode.

Reimplemented from HuginBase::BaseSrcPanoImage.

Definition at line 1601 of file SrcPanoImage.h.

void HuginBase::SrcPanoImage::unlinkRadialVigCorrCenterShift (  )  [inline]

unlinking vignetting parameters should unlink the vignetting correction mode

Reimplemented from HuginBase::BaseSrcPanoImage.

Definition at line 1593 of file SrcPanoImage.h.

void HuginBase::SrcPanoImage::unlinkRadialVigCorrCoeff (  )  [inline]

unlinking vignetting parameters should unlink the vignetting correction mode

Reimplemented from HuginBase::BaseSrcPanoImage.

Definition at line 1585 of file SrcPanoImage.h.

void HuginBase::SrcPanoImage::updateCropFactor ( double  focalLength,
double  newCropFactor 
)

updates the crop factor, the hfov is calculates so that focal length remains the same

Definition at line 1697 of file SrcPanoImage.cpp.

void HuginBase::SrcPanoImage::updateFocalLength ( double  newFocalLength  ) 

updates the focal length, changes the hfov to reflect thew newFocalLength

Definition at line 1688 of file SrcPanoImage.cpp.


The documentation for this class was generated from the following files:
Generated on 26 May 2016 for Hugintrunk by  doxygen 1.4.7