Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
HuginBase::PanoramaData Class Referenceabstract

Model for a panorama. More...

#include <PanoramaData.h>

Inheritance diagram for HuginBase::PanoramaData:
Inheritance graph

Public Member Functions

virtual ~PanoramaData ()
 
virtual PanoramaDatagetNewSubset (const UIntSet &imgs) const =0
 
virtual PanoramaDatagetNewCopy () const =0
 
virtual PanoramaDatagetUnlinkedSubset (UIntSetVector &imageGroups) const =0
 
virtual std::size_t getNrOfImages () const =0
 number of images. More...
 
virtual const SrcPanoImagegetImage (std::size_t nr) const =0
 get a panorama image, counting starts with 0 More...
 
virtual void setImage (std::size_t nr, const SrcPanoImage &img)=0
 set a panorama image, counting starts with 0 More...
 
virtual unsigned int addImage (const SrcPanoImage &img)=0
 the the number for a specific image More...
 
virtual void removeImage (unsigned int nr)=0
 creates an image, from filename, and a Lens, if needed More...
 
virtual void swapImages (unsigned int img1, unsigned int img2)=0
 swap images. More...
 
virtual void moveImage (size_t img1, size_t img2)=0
 moves images. More...
 
virtual SrcPanoImage getSrcImage (unsigned imgNr) const =0
 get a complete description of a source image More...
 
virtual void setSrcImage (unsigned int nr, const SrcPanoImage &img)=0
 set input image parameters TODO: Propagate changes to linked images. More...
 
virtual void setImageFilename (unsigned int img, const std::string &fname)=0
 set a new image filename More...
 
virtual void activateImage (unsigned int imgNr, bool active=true)=0
 mark an image as active or inactive. More...
 
virtual UIntSet getActiveImages () const =0
 get active images More...
 
virtual std::size_t getNrOfCtrlPoints () const =0
 number of control points More...
 
virtual const ControlPointgetCtrlPoint (std::size_t nr) const =0
 get a control point, counting starts with 0 More...
 
virtual const CPVectorgetCtrlPoints () const =0
 get all control point of this Panorama More...
 
virtual std::vector< unsigned int > getCtrlPointsForImage (unsigned int imgNr) const =0
 return all control points for a given image. More...
 
virtual void setCtrlPoints (const CPVector &points)=0
 set all control points (Ippei: Is this supposed to be 'add' method?) More...
 
virtual unsigned int addCtrlPoint (const ControlPoint &point)=0
 add a new control point. More...
 
virtual void removeCtrlPoint (unsigned int pNr)=0
 remove a control point. More...
 
virtual void removeDuplicateCtrlPoints ()=0
 removes duplicates control points More...
 
virtual void changeControlPoint (unsigned int pNr, const ControlPoint &point)=0
 change a control Point. More...
 
virtual int getNextCPTypeLineNumber () const =0
 get the number of a control point More...
 
virtual void updateLineCtrlPoints ()=0
 assign new mode line numbers, if required More...
 
virtual void updateCtrlPointErrors (const CPVector &controlPoints)=0
 update control points distances. More...
 
virtual void updateCtrlPointErrors (const UIntSet &imgs, const CPVector &cps)=0
 update control points for a subset of images. More...
 
virtual VariableMapVector getVariables () const =0
 get variables of this panorama More...
 
virtual const VariableMap getImageVariables (unsigned int imgNr) const =0
 get variables of an image More...
 
virtual void updateVariables (const VariableMapVector &vars)=0
 Set the variables. More...
 
virtual void updateVariables (const UIntSet &imgs, const VariableMapVector &var)=0
 update variables for some specific images More...
 
virtual void updateVariables (unsigned int imgNr, const VariableMap &var)=0
 Set variables for a single picture. More...
 
virtual void updateVariable (unsigned int imgNr, const Variable &var)=0
 update a single variable More...
 
virtual void updateWhiteBalance (double redFactor, double blueFactor)=0
 update the global white balace of the panorama by multiplying the red and blue factor of each image with given factors More...
 
virtual const OptimizeVectorgetOptimizeVector () const =0
 return the optimize settings stored inside panorama More...
 
virtual void setOptimizeVector (const OptimizeVector &optvec)=0
 set optimize setting More...
 
virtual const int getOptimizerSwitch () const =0
 returns optimizer master switch More...
 
virtual void setOptimizerSwitch (const int newSwitch)=0
 set optimizer master switch More...
 
virtual const int getPhotometricOptimizerSwitch () const =0
 return the photometric optimizer master switch More...
 
virtual void setPhotometricOptimizerSwitch (const int newSwitch)=0
 sets the photometric optimizer master switch More...
 
virtual const PanoramaOptionsgetOptions () const =0
 returns the options for this panorama More...
 
virtual void setOptions (const PanoramaOptions &opt)=0
 set new output settings This is not used directly for optimizing/stiching, but it can be feed into runOptimizer() and runStitcher(). More...
 
virtual void printPanoramaScript (std::ostream &o, const OptimizeVector &optvars, const PanoramaOptions &options, const UIntSet &imgs, bool forPTOptimizer, const std::string &stripPrefix="") const =0
 create an optimizer script More...
 
virtual void printStitcherScript (std::ostream &o, const PanoramaOptions &target, const UIntSet &imgs) const =0
 create the stitcher script More...
 
virtual void changeFinished ()=0
 tells the data container to perform some maintainance if neccesary More...
 
virtual void imageChanged (unsigned int imgNr)=0
 mark image change for maintainance More...
 
virtual void updateMasksForImage (unsigned int imgNr, MaskPolygonVector newMasks)=0
 set complete mask list for image with number More...
 
virtual void updateMasks (bool convertPosMaskToNeg=false)=0
 updates all active masks More...
 
virtual void transferMask (MaskPolygon mask, unsigned int imgNr, const UIntSet &targetImgs)=0
 transfers given mask from image imgNr to all targetImgs More...
 
virtual void updateOptimizeVector ()=0
 updates the optimize vector according to master switches More...
 
virtual std::set< size_t > getRefImages ()=0
 returns set of reference image and images linked with reference images More...
 
virtual void checkRefOptStatus (bool &linkRefImgsYaw, bool &linkRefImgsPitch, bool &linkRefImgsRoll)=0
 checks if yaw/pitch/roll of reference image can be check, it depends on number and type of control points More...
 

Detailed Description

Model for a panorama.

This class contains the properties of a panorama That is:

view and controller classes can get information about these with the getXXX Functions.

Images and Control points are numbered, and const references are handed out. this means that all interaction will be based on image or control point numbers. The references are not stable, they might disappear when other functions of this class are called, so its best to get a new reference whenever you need the object.

This also means that the whole object is not threadsafe and concurrent access has to be synchronized from the outside.

Definition at line 81 of file PanoramaData.h.

Constructor & Destructor Documentation

virtual HuginBase::PanoramaData::~PanoramaData ( )
inlinevirtual

Definition at line 87 of file PanoramaData.h.

Member Function Documentation

virtual void HuginBase::PanoramaData::activateImage ( unsigned int  imgNr,
bool  active = true 
)
pure virtual

mark an image as active or inactive.

This is only a flag, that can be turned on or off. If an image is marked active, then it should be used for optimizing and stitching.

However, this is not done automatically. One has to use getActiveImages() to get the numbers of the active images, and pass these to the respective functions that do the stitching or optimisation

Implemented in HuginBase::Panorama.

virtual unsigned int HuginBase::PanoramaData::addCtrlPoint ( const ControlPoint point)
pure virtual

add a new control point.

Implemented in HuginBase::Panorama.

virtual unsigned int HuginBase::PanoramaData::addImage ( const SrcPanoImage img)
pure virtual

the the number for a specific image

add an Image to the panorama

The Image must be initialized, the Lens must exist.

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::changeControlPoint ( unsigned int  pNr,
const ControlPoint point 
)
pure virtual

change a control Point.

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::changeFinished ( )
pure virtual

tells the data container to perform some maintainance if neccesary

Implemented in HuginBase::Panorama, and HuginBase::ManagedPanoramaData.

virtual void HuginBase::PanoramaData::checkRefOptStatus ( bool &  linkRefImgsYaw,
bool &  linkRefImgsPitch,
bool &  linkRefImgsRoll 
)
pure virtual

checks if yaw/pitch/roll of reference image can be check, it depends on number and type of control points

Implemented in HuginBase::Panorama.

virtual UIntSet HuginBase::PanoramaData::getActiveImages ( ) const
pure virtual
virtual const ControlPoint& HuginBase::PanoramaData::getCtrlPoint ( std::size_t  nr) const
pure virtual

get a control point, counting starts with 0

Implemented in HuginBase::Panorama.

Referenced by optGetError().

virtual const CPVector& HuginBase::PanoramaData::getCtrlPoints ( ) const
pure virtual
virtual std::vector<unsigned int> HuginBase::PanoramaData::getCtrlPointsForImage ( unsigned int  imgNr) const
pure virtual

return all control points for a given image.

Implemented in HuginBase::Panorama.

virtual const SrcPanoImage& HuginBase::PanoramaData::getImage ( std::size_t  nr) const
pure virtual

get a panorama image, counting starts with 0

Implemented in HuginBase::Panorama.

Referenced by HuginBase::PTOptEstimator::agree(), HuginBase::CalculateCPStatisticsRadial::calcCtrlPntsRadiStats(), HuginBase::CalculateMeanExposure::calcMeanExposure(), HuginBase::CalculateOptimalROI::calcOptimalROI(), HuginBase::StraightenPanorama::calcStraighteningRotation(), HuginBase::CalculateImageOverlap::calculate(), HuginBase::CenterHorizontally::centerHorizontically(), HuginBase::CheckStrangeWB(), HuginBase::Nona::SpaceTransform::createInvTransform(), HuginBase::PTools::Transform::createInvTransform(), HuginBase::SmartOptimizerStub::createOptVars(), HuginBase::Nona::SpaceTransform::createTransform(), HuginBase::PTools::Transform::createTransform(), HuginBase::getExposureLayers(), GetMinimumGuiLevel(), HuginBase::SmallRemappedImageCache::getRemapped(), HuginBase::Nona::FileRemapper< ImageType, AlphaType >::getRemapped(), HuginGraph::ImageGraph::ImageGraph(), HuginBase::PTOptEstimator::leastSquaresEstimate(), HuginBase::PhotometricOptimizer::OptimData::OptimData(), PanoDetector::RansacMatchesInPairCam(), HuginBase::RotatePanorama::rotatePano(), HuginBase::AllPointSampler::sampleAllPanoPoints(), HuginBase::RandomPointSampler::sampleRandomPanoPoints(), HuginBase::SmartPhotometricOptimizer::smartOptimizePhotometric(), HuginBase::CalculateOptimalROI::stackPixel(), HuginBase::Nona::MultiImageRemapper< ImageType, AlphaImageType >::stitch(), HuginBase::Nona::WeightedStitcher< ImageType, AlphaType >::stitch(), HuginBase::Nona::stitchPanorama(), and HuginBase::TranslatePanorama::translatePano().

virtual const VariableMap HuginBase::PanoramaData::getImageVariables ( unsigned int  imgNr) const
pure virtual

get variables of an image

Depreciated: Please use SrcPanoImage objects for variable access.

Todo:
remove when not used.

Note: no longer returns a reference as the no variable map with the correct values exists, now we use individual member variables in SrcPanoImage.

Implemented in HuginBase::Panorama.

Referenced by HuginBase::AutoOptimise::autoOptimise(), HuginBase::StraightenPanorama::calcStraighteningRotation(), HuginBase::PTools::Transform::createInvTransform(), HuginBase::PTools::Transform::createTransform(), HuginBase::SmartOptimise::smartOptimize(), and HuginBase::AutoOptimiseVisitor::Visit().

virtual PanoramaData* HuginBase::PanoramaData::getNewCopy ( ) const
pure virtual
virtual PanoramaData* HuginBase::PanoramaData::getNewSubset ( const UIntSet imgs) const
pure virtual
virtual int HuginBase::PanoramaData::getNextCPTypeLineNumber ( ) const
pure virtual

get the number of a control point

get the next unused line number for t3, ... control point creation

Implemented in HuginBase::Panorama.

virtual std::size_t HuginBase::PanoramaData::getNrOfCtrlPoints ( ) const
pure virtual

number of control points

Implemented in HuginBase::Panorama.

Referenced by HuginBase::PTools::calcCtrlPointErrors(), optGetError(), and optimize_new().

virtual std::size_t HuginBase::PanoramaData::getNrOfImages ( ) const
pure virtual
virtual const int HuginBase::PanoramaData::getOptimizerSwitch ( ) const
pure virtual

returns optimizer master switch

Implemented in HuginBase::Panorama.

virtual const OptimizeVector& HuginBase::PanoramaData::getOptimizeVector ( ) const
pure virtual

return the optimize settings stored inside panorama

Implemented in HuginBase::Panorama.

Referenced by HuginBase::PTools::optimize().

virtual const PanoramaOptions& HuginBase::PanoramaData::getOptions ( ) const
pure virtual
virtual const int HuginBase::PanoramaData::getPhotometricOptimizerSwitch ( ) const
pure virtual

return the photometric optimizer master switch

Implemented in HuginBase::Panorama.

virtual std::set<size_t> HuginBase::PanoramaData::getRefImages ( )
pure virtual

returns set of reference image and images linked with reference images

Implemented in HuginBase::Panorama.

virtual SrcPanoImage HuginBase::PanoramaData::getSrcImage ( unsigned  imgNr) const
pure virtual
virtual PanoramaData* HuginBase::PanoramaData::getUnlinkedSubset ( UIntSetVector imageGroups) const
pure virtual
virtual VariableMapVector HuginBase::PanoramaData::getVariables ( ) const
pure virtual
virtual void HuginBase::PanoramaData::imageChanged ( unsigned int  imgNr)
pure virtual
virtual void HuginBase::PanoramaData::moveImage ( size_t  img1,
size_t  img2 
)
pure virtual

moves images.

moves the image from pos1 to pos2

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::printPanoramaScript ( std::ostream &  o,
const OptimizeVector optvars,
const PanoramaOptions options,
const UIntSet imgs,
bool  forPTOptimizer,
const std::string &  stripPrefix = "" 
) const
pure virtual
virtual void HuginBase::PanoramaData::printStitcherScript ( std::ostream &  o,
const PanoramaOptions target,
const UIntSet imgs 
) const
pure virtual

create the stitcher script

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::removeCtrlPoint ( unsigned int  pNr)
pure virtual

remove a control point.

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::removeDuplicateCtrlPoints ( )
pure virtual

removes duplicates control points

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::removeImage ( unsigned int  nr)
pure virtual

creates an image, from filename, and a Lens, if needed

add an Image to the panorama

Returns
image numberremove an Image.

also deletes/updates all associated control points.

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::setCtrlPoints ( const CPVector points)
pure virtual
virtual void HuginBase::PanoramaData::setImage ( std::size_t  nr,
const SrcPanoImage img 
)
pure virtual

set a panorama image, counting starts with 0

Implemented in HuginBase::Panorama.

Referenced by HuginBase::RotatePanorama::rotatePano(), and HuginBase::TranslatePanorama::translatePano().

virtual void HuginBase::PanoramaData::setImageFilename ( unsigned int  img,
const std::string &  fname 
)
pure virtual

set a new image filename

It is assumed that it is of the same size as the old image.

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::setOptimizerSwitch ( const int  newSwitch)
pure virtual

set optimizer master switch

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::setOptimizeVector ( const OptimizeVector optvec)
pure virtual
virtual void HuginBase::PanoramaData::setOptions ( const PanoramaOptions opt)
pure virtual

set new output settings This is not used directly for optimizing/stiching, but it can be feed into runOptimizer() and runStitcher().

Implemented in HuginBase::Panorama.

Referenced by HuginBase::Panorama::getUnlinkedSubset(), HuginBase::FitPanorama::runAlgorithm(), HuginBase::SetWidthOptimal::runAlgorithm(), HuginBase::PointSampler::sampleAndExtractPoints(), and HuginBase::SmartOptimise::smartOptimize().

virtual void HuginBase::PanoramaData::setPhotometricOptimizerSwitch ( const int  newSwitch)
pure virtual

sets the photometric optimizer master switch

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::setSrcImage ( unsigned int  nr,
const SrcPanoImage img 
)
pure virtual

set input image parameters TODO: Propagate changes to linked images.

Implemented in HuginBase::Panorama.

Referenced by HuginBase::PhotometricOptimizer::optimizePhotometric(), HuginBase::PointSampler::sampleAndExtractPoints(), and OptimData::SaveToImgs().

virtual void HuginBase::PanoramaData::swapImages ( unsigned int  img1,
unsigned int  img2 
)
pure virtual

swap images.

swaps the images, image img1 becomes img2 and the other way round

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::transferMask ( MaskPolygon  mask,
unsigned int  imgNr,
const UIntSet targetImgs 
)
pure virtual

transfers given mask from image imgNr to all targetImgs

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::updateCtrlPointErrors ( const CPVector controlPoints)
pure virtual

update control points distances.

updates control distances and position in final panorama usually used to set the changes from the optimization. The control points must be the same as in

Implemented in HuginBase::Panorama.

Referenced by HuginBase::PTools::calcCtrlPointErrors(), optGetError(), and HuginBase::PTools::optimize().

virtual void HuginBase::PanoramaData::updateCtrlPointErrors ( const UIntSet imgs,
const CPVector cps 
)
pure virtual

update control points for a subset of images.

Usually, the control point subset is created using subset() The number and ordering and control points must not be changed between the call to subset() and this function.

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::updateLineCtrlPoints ( )
pure virtual

assign new mode line numbers, if required

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::updateMasks ( bool  convertPosMaskToNeg = false)
pure virtual

updates all active masks

this is necessary after variables of one image has changed, because positive masks have to be updated

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::updateMasksForImage ( unsigned int  imgNr,
MaskPolygonVector  newMasks 
)
pure virtual

set complete mask list for image with number

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::updateOptimizeVector ( )
pure virtual

updates the optimize vector according to master switches

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::updateVariable ( unsigned int  imgNr,
const Variable var 
)
pure virtual

update a single variable

It updates other images when the variable is linked

Implemented in HuginBase::Panorama.

Referenced by HuginBase::RANSACOptimizer::findInliers(), and HuginBase::OptVarSpec::set().

virtual void HuginBase::PanoramaData::updateVariables ( const VariableMapVector vars)
pure virtual
virtual void HuginBase::PanoramaData::updateVariables ( const UIntSet imgs,
const VariableMapVector var 
)
pure virtual

update variables for some specific images

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::updateVariables ( unsigned int  imgNr,
const VariableMap var 
)
pure virtual

Set variables for a single picture.

Implemented in HuginBase::Panorama.

virtual void HuginBase::PanoramaData::updateWhiteBalance ( double  redFactor,
double  blueFactor 
)
pure virtual

update the global white balace of the panorama by multiplying the red and blue factor of each image with given factors

Implemented in HuginBase::Panorama.


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