50 result &= (**it).processPanorama(pano);
64 std::vector<HuginBase::SrcPanoImage>::const_iterator
it;
80 for (HuginBase::UIntSet::reverse_iterator
it =
imgNrs.rbegin();
97 HuginBase::CPVector::const_iterator
it;
135 HuginBase::UIntSet::iterator
it;
136 HuginBase::VariableMapVector::const_iterator
v_it =
vars.begin();
181 HuginBase::UIntSet::iterator
it;
260 for (HuginBase::CPVector::iterator
it =
cps.begin();
it !=
cps.end(); ++
it)
262 if ((*it).image1Nr > (*it).image2Nr)
266 imgs.insert(
it->image1Nr);
267 imgs.insert(
it->image2Nr);
310 HuginBase::UIntSet::iterator
it;
371 :
PanoCommand(p), filename(filename), prefix(prefix)
414 for (HuginBase::UIntSet::const_iterator
it =
imgNrs.begin();
it !=
imgNrs.end(); ++
it)
474 group.updatePartNumbers();
485 std::set<HuginBase::ImageVariableGroup::ImageVariableEnum>::iterator
it;
494#define image_variable( name, type, default_value )\
495 bool ChangeImage##name##Cmd::processPanorama(HuginBase::Panorama& pano)\
497 for (HuginBase::UIntSet::iterator it = image_numbers.begin(); it != image_numbers.end(); it++)\
499 HuginBase::SrcPanoImage img = pano.getSrcImage(*it);\
500 img.set##name(value);\
501 pano.setSrcImage(*it, img);\
513 for (std::set<HuginBase::ImageVariableGroup::ImageVariableEnum>::iterator
it =
vars.begin();
it !=
vars.end(); ++
it)
517#define image_variable( name, type, default_value )\
518 case HuginBase::ImageVariableGroup::IVE_##name:\
519 pano.unlinkImageVariable##name(image_index);\
562 const double hfov = img.getHFOV();
568 imgsPerRow = std::max(3,
int(360 / (0.8*hfov)));
576 double offset = 0.75*hfov;
581 double yaw = -(
imgsPerRow - 1.0) / 2.0*offset;
585 pitch = (-(std::ceil(
double(nrImages) /
double(
imgsPerRow)) - 1.0) / 2.0*offset);
589 for (
size_t i = 0;
i<nrImages;
i++)
591 HuginBase::VariableMap::iterator
it =
varsVec[
i].find(
"y");
594 it->second.setValue(yaw);
599 it->second.setValue(pitch);
function to parse expressions from strings
virtual double getResultHorizontalFOV()
virtual double getResultHeight()
static double calcMeanExposure(const PanoramaData &pano)
unsigned int getPartNumber(unsigned int imageNr) const
Get a part number from an image number.
represents a control point
void mirror()
swap (image1Nr,x1,y1) with (image2Nr,x2,y2)
Same as above, but use a non const panorama.
void linkVariablePart(ImageVariableEnum variable, unsigned int partNr)
link one of the variables across a given part
virtual void run()
runs the algorithm.
void setHFOV(double h, bool keepView=true)
set the horizontal field of view.
void setHeight(unsigned int h)
set panorama height
double outputExposureValue
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
const PanoramaOptions & getOptions() const
returns the options for this panorama
void updateMasksForImage(unsigned int imgNr, MaskPolygonVector newMasks)
set complete mask list for image with number
void setOptimizeVector(const OptimizeVector &optvec)
set optimize setting
virtual void UpdateCropFactor(UIntSet imgs, double newCropFactor)
updates the crop factor, try to keep focal length constant
virtual void updateWhiteBalance(double redFactor, double blueFactor)
update the global white balace of the panorama by multiplying the red and blue factor of each image w...
void removeImage(unsigned int nr)
creates an image, from filename, and a Lens, if needed
void setCtrlPoints(const CPVector &points)
set all control points (Ippei: Is this supposed to be 'add' method?)
bool ReadPTOFile(const std::string &filename, const std::string &prefix="")
read pto file from the given filename into Panorama object it does some checks on the file and issues...
void mergePanorama(const Panorama &newPano)
merges the panorama with the given pano
unsigned int addCtrlPoint(const ControlPoint &point)
add a new control point.
virtual void updateVariable(unsigned int imgNr, const Variable &var)
update a single variable
virtual void UpdateFocalLength(UIntSet imgs, double newFocalLength)
updates the focal length by changing hfov
unsigned int addImage(const SrcPanoImage &img)
the the number for a specific image
void swapImages(unsigned int img1, unsigned int img2)
swap images.
void setOptions(const PanoramaOptions &opt)
set new output settings This is not used directly for optimizing/stiching, but it can be feed into ru...
void markAsOptimized(bool optimized=true)
void setSrcImage(unsigned int nr, const SrcPanoImage &img)
set input image parameters
void activateImage(unsigned int imgNr, bool active=true)
mark an image as active or inactive.
void moveImage(size_t img1, size_t img2)
moves images.
VariableMapVector getVariables() const
get variables of this panorama
virtual void updateVariables(const VariableMapVector &vars)
Set the variables.
Panorama getSubset(const UIntSet &imgs) const
get a subset of the panorama
void changeControlPoint(unsigned int pNr, const ControlPoint &point)
change a control Point.
void updateCtrlPointErrors(const CPVector &controlPoints)
update control points distances.
Panorama duplicate() const
duplicate the panorama
void setPhotometricOptimizerSwitch(const int newSwitch)
sets the photometric optimizer master switch
void reset()
clear the internal state.
void removeCtrlPoint(unsigned int pNr)
remove a control point.
void setOptimizerSwitch(const int newSwitch)
set optimizer master switch
std::size_t getNrOfImages() const
number of images.
All variables of a source image.
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::ControlPoint point
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
std::vector< HuginBase::SrcPanoImage > imgs
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::ControlPoint point
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
std::set< HuginBase::ImageVariableGroup::ImageVariableEnum > groupVariables
HuginBase::UIntSet image_numbers
std::set< HuginBase::ImageVariableGroup::ImageVariableEnum > changeVariables
std::set< HuginBase::ImageVariableGroup::ImageVariableEnum > variables
std::size_t new_part_number
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::UIntSet image_numbers
std::vector< PanoCommand * > commands
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
std::set< HuginBase::ImageVariableGroup::ImageVariableEnum > variables
LoadPTProjectCmd(HuginBase::Panorama &p, const std::string &filename, const std::string &prefix="")
const std::string & filename
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::Panorama newPano
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
std::set< HuginBase::ImageVariableGroup::ImageVariableEnum > vars
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::UIntSet image_numbers
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::UIntSet m_points
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::UIntSet imgNrs
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::UIntSet m_active
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::PanoramaOptions options
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::UIntSet images
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::UIntSet imgNrs
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::UIntSet imgNrs
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::VariableMap vars
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::VariableMapVector vars
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::UIntSet change
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::MaskPolygonVector m_mask
HuginBase::OptimizeVector m_optvec
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::SrcPanoImage img
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::UIntSet imgNrs
std::vector< HuginBase::SrcPanoImage > imgs
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::VariableMapVector vars
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::UIntSet m_imgs
HuginBase::VariableMapVector vars
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
HuginBase::VariableMapVector vars
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
virtual bool processPanorama(HuginBase::Panorama &pano)
Called by execute().
#define DEBUG_ASSERT(cond)
This file specifies what image variables SrcPanoImg should have.
std::vector< VariableMap > VariableMapVector
std::vector< ControlPoint > CPVector
std::set< unsigned int > UIntSet
void UpdateSingleCtrlPointError(const HuginBase::Panorama &pano, HuginBase::ControlPoint &point)
void PanoParseExpression(HuginBase::Panorama &pano, const std::string &expression, std::ostream &statusStream, std::ostream &errorStream)
parses the given expression and apply the changes to the Panorama
bool set_contains(const _Container &c, const typename _Container::key_type &key)
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.