44 list->SetSelection(0);
52 lensInfo.name =
_(
"Normal (rectilinear)");
55 lensInfo.name =
_(
"Panoramic (cylindrical)");
87 list->SetSelection(0);
92 for(
unsigned int i=0;
i<list->GetCount();
i++)
94 if((
size_t)list->GetClientData(
i)==
newValue)
96 list->SetSelection(
i);
100 list->SetSelection(0);
105 return (
size_t)(list->GetClientData(list->GetSelection()));
111 switch (img.getProjection())
129 switch (img.getResponseType())
132 s =
_(
"custom (EMoR)");
166 if (std::string(*varname) ==
"v")
181 cfg.Write(
"Lens/crop/autoCenter", image.getAutoCenterCrop() ? 1l : 0l);
182 const vigra::Rect2D
cropRect=image.getCropRect();
188 if (!image.getExifMake().empty() && !image.getExifModel().empty() && image.getExifFocalLength()>0)
193 cfg.Write(
"EXIF/FocalLength", image.getExifFocalLength());
194 cfg.Write(
"EXIF/Aperture", image.getExifAperture());
195 cfg.Write(
"EXIF/ISO", image.getExifISO());
196 cfg.Write(
"EXIF/CropFactor", image.getCropFactor());
197 cfg.Write(
"EXIF/Distance", image.getExifDistance());
211 bool autoCenterCrop=
false;
218 for(HuginBase::UIntSet::const_iterator
it=images.begin();
it!=images.end();++
it,++
i)
223 if (
it2->second.getName() ==
"Eev" ||
it2->second.getName() ==
"Er" ||
it2->second.getName() ==
"Eb")
227 vars[
i].find(
it2->first)->second.setValue(
it2->second.getValue());
234 std::vector<PanoCommand::PanoCommand*>
cmds;
236 std::set<HuginBase::ImageVariableGroup::ImageVariableEnum>
linkedVariables;
240 if(
it->second.getName()==
"Eev" ||
it->second.getName() ==
"Er" ||
it->second.getName() ==
"Eb")
244#define image_variable( name, type, default_value ) \
245 if (HuginBase::PTOVariableConverterFor##name::checkApplicability(it->second.getName()))\
247 if(it->second.isLinked())\
248 linkedVariables.insert(HuginBase::ImageVariableGroup::IVE_##name);\
250 unlinkedVariables.insert(HuginBase::ImageVariableGroup::IVE_##name);\
271 cmds.push_back(
new PanoCommand::ChangeImageCropFactorCmd(*pano,images,lens.
getCropFactor()));
273 cmds.push_back(
new PanoCommand::ChangeImageAutoCenterCropCmd(*pano,images,autoCenterCrop));
276 cmds.push_back(
new PanoCommand::ChangeImageCropRectCmd(*pano,images,
cropRect));
296 _(
"Load lens parameters"),
298 _(
"Lens Project Files (*.ini)|*.ini|All files (*.*)|*.*"),
304 wxConfig::Get()->Write(
"/lensPath",
dlg.GetDirectory());
312 cfg.Read(
"Lens/image_width", &
w);
314 cfg.Read(
"Lens/image_height", &h);
317 if (
w !=
sz.x || h !=
sz.y) {
318 std::cerr <<
"Image size: " <<
sz <<
" size in lens parameter file: " <<
w <<
"x" << h << std::endl;
337 if(
cfg.Read(
"Lens/crop", &
d))
343 if(
cfg.Read(
"Lens/hfov", &
d))
376 cfg.Read(
"Lens/crop/enabled", &
v);
384 if(
cfg.Read(
"Lens/crop/left", &left) &&
cfg.Read(
"Lens/crop/top", &top) &&
385 cfg.Read(
"Lens/crop/right", &right) &&
cfg.Read(
"Lens/crop/bottom", &bottom))
388 cropRect=vigra::Rect2D(left,top,right,bottom);
396 if(
cfg.Read(
"Lens/crop/autoCenter", &
v))
398 autoCenterCrop=(
v!=0);
414 if (images.size() == 1)
416 unsigned int imgNr = *(images.begin());
418 _(
"Save lens parameters file"),
420 _(
"Lens Project Files (*.ini)|*.ini|All files (*)|*"),
426 if(!filename.HasExt())
428 filename.SetExt(
"ini");
429 if (filename.Exists())
437 wxConfig::Get()->Write(
"/lensPath",
dlg.GetDirectory());
443 wxLogError(
_(
"Please select an image and try again"));
455 for (
size_t i = 0;
i < nrImages - 1; ++
i)
458 if (image1.YawisLinked())
463 if (image1.YawisLinkedWith(image2))
466 image1.HFOVisLinkedWith(image2) &&
467 image1.RadialDistortionisLinkedWith(image2) &&
468 image1.RadialDistortionCenterShiftisLinkedWith(image2) &&
469 image1.ShearisLinkedWith(image2);
485 if (
hugin_utils::HuginMessageBox(
_(
"This project contains stacks with linked positions. But the lens parameters are not linked for these images.\nThis will result in unwanted results.\nPlease check and correct this before proceeding."),
518 if (img->getExifFocalLength() > 0.0)
520 if (img->getExifFocalLength35() > 0.0)
522 s = wxString::Format(
"%0.1f mm (%0.0f mm)", img->getExifFocalLength(), img->getExifFocalLength35());
526 s = wxString::Format(
"%0.1f mm", img->getExifFocalLength());
539 if (img->getExifAperture() > 0)
541 s = wxString::Format(
"F%.1f", img->getExifAperture());
590 if (img->getExifISO() > 0)
592 s = wxString::Format(
"%0.0f", img->getExifISO());
Convenience functions for SrcPanoImage to use on the image variables.
Somewhere to specify what variables belong to what.
@ RESPONSE_LINEAR
linear response
@ RESPONSE_EMOR
empirical model of response
static const std::set< ConstImageVariableGroup::ImageVariableEnum > & getLensVariables()
Get the set of lens image variables.
vigra::Size2D getImageSize() const
get the image size, in pixels
void setProjection(LensProjectionFormat l)
set projection type
double getCropFactor() const
get crop factor, d35mm/dreal
void setCropFactor(double newCropFactor)
sets the crop factor
LensProjectionFormat getProjection() const
get projection type
static const char * variableNames[]
const VariableMap getImageVariables(unsigned int imgNr) const
Get the variables of an image.
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
std::size_t getNrOfImages() const
number of images.
All variables of a source image.
const int getExifDateTime(struct tm *datetime) const
try to convert Exif date time string to struct tm
Change the linking of some variables across parts of an ImageVariableGroup containing some specified ...
PanoCommand to combine other PanoCommands.
Base class for all panorama commands.
update variables of a group of images
This file specifies what image variables SrcPanoImg should have.
std::vector< VariableMap > VariableMapVector
std::set< unsigned int > UIntSet
std::map< std::string, Variable > VariableMap
bool AskUserOverwrite(const wxString &filename, const wxString &caption, wxWindow *parent)
ask user if the given file should be overwritten, return true if the user confirmed the overwritting
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
include file for the hugin project
include file for the hugin project
Map::mapped_type & map_get(Map &m, const typename Map::key_type &key)
get a map element.
const Map::mapped_type & const_map_get(const Map &m, const typename Map::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.