45 list->SetSelection(0);
54 lensInfo.name =
_(
"Normal (rectilinear)");
57 lensInfo.name =
_(
"Panoramic (cylindrical)");
88 list->SetSelection(0);
110 for(
unsigned int i=0;
i<list->GetCount();
i++)
112 if((
size_t)list->GetClientData(
i)==
newValue)
114 list->SetSelection(
i);
118 list->SetSelection(0);
123 return (
size_t)(list->GetClientData(list->GetSelection()));
129 switch (img.getProjection())
147 switch (img.getResponseType())
150 s =
_(
"custom (EMoR)");
184 if (std::string(*varname) ==
"v")
199 cfg.Write(
"Lens/crop/autoCenter", image.getAutoCenterCrop() ? 1l : 0l);
200 const vigra::Rect2D
cropRect=image.getCropRect();
206 if (!image.getExifMake().empty() && !image.getExifModel().empty() && image.getExifFocalLength()>0)
211 cfg.Write(
"EXIF/FocalLength", image.getExifFocalLength());
212 cfg.Write(
"EXIF/Aperture", image.getExifAperture());
213 cfg.Write(
"EXIF/ISO", image.getExifISO());
214 cfg.Write(
"EXIF/CropFactor", image.getCropFactor());
215 cfg.Write(
"EXIF/Distance", image.getExifDistance());
229 bool autoCenterCrop=
false;
236 for(HuginBase::UIntSet::const_iterator
it=images.begin();
it!=images.end();++
it,++
i)
241 if (
it2->second.getName() ==
"Eev" ||
it2->second.getName() ==
"Er" ||
it2->second.getName() ==
"Eb")
245 vars[
i].find(
it2->first)->second.setValue(
it2->second.getValue());
252 std::vector<PanoCommand::PanoCommand*>
cmds;
254 std::set<HuginBase::ImageVariableGroup::ImageVariableEnum>
linkedVariables;
258 if(
it->second.getName()==
"Eev" ||
it->second.getName() ==
"Er" ||
it->second.getName() ==
"Eb")
262#define image_variable( name, type, default_value ) \
263 if (HuginBase::PTOVariableConverterFor##name::checkApplicability(it->second.getName()))\
265 if(it->second.isLinked())\
266 linkedVariables.insert(HuginBase::ImageVariableGroup::IVE_##name);\
268 unlinkedVariables.insert(HuginBase::ImageVariableGroup::IVE_##name);\
289 cmds.push_back(
new PanoCommand::ChangeImageCropFactorCmd(*pano,images,lens.
getCropFactor()));
291 cmds.push_back(
new PanoCommand::ChangeImageAutoCenterCropCmd(*pano,images,autoCenterCrop));
294 cmds.push_back(
new PanoCommand::ChangeImageCropRectCmd(*pano,images,
cropRect));
314 _(
"Load lens parameters"),
316 _(
"Lens Project Files (*.ini)|*.ini|All files (*.*)|*.*"),
322 wxConfig::Get()->Write(
"/lensPath",
dlg.GetDirectory());
330 cfg.Read(
"Lens/image_width", &
w);
332 cfg.Read(
"Lens/image_height", &h);
335 if (
w !=
sz.x || h !=
sz.y) {
336 std::cerr <<
"Image size: " <<
sz <<
" size in lens parameter file: " <<
w <<
"x" << h << std::endl;
355 if(
cfg.Read(
"Lens/crop", &
d))
361 if(
cfg.Read(
"Lens/hfov", &
d))
394 cfg.Read(
"Lens/crop/enabled", &
v);
402 if(
cfg.Read(
"Lens/crop/left", &left) &&
cfg.Read(
"Lens/crop/top", &top) &&
403 cfg.Read(
"Lens/crop/right", &right) &&
cfg.Read(
"Lens/crop/bottom", &bottom))
406 cropRect=vigra::Rect2D(left,top,right,bottom);
414 if(
cfg.Read(
"Lens/crop/autoCenter", &
v))
416 autoCenterCrop=(
v!=0);
432 if (images.size() == 1)
434 unsigned int imgNr = *(images.begin());
436 _(
"Save lens parameters file"),
438 _(
"Lens Project Files (*.ini)|*.ini|All files (*)|*"),
444 if(!filename.HasExt())
446 filename.SetExt(
"ini");
447 if (filename.Exists())
455 wxConfig::Get()->Write(
"/lensPath",
dlg.GetDirectory());
461 wxLogError(
_(
"Please select an image and try again"));
473 for (
size_t i = 0;
i < nrImages - 1; ++
i)
476 if (image1.YawisLinked())
481 if (image1.YawisLinkedWith(image2))
484 image1.HFOVisLinkedWith(image2) &&
485 image1.RadialDistortionisLinkedWith(image2) &&
486 image1.RadialDistortionCenterShiftisLinkedWith(image2) &&
487 image1.ShearisLinkedWith(image2);
503 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."),
536 if (img->getExifFocalLength() > 0.0)
538 if (img->getExifFocalLength35() > 0.0)
540 s = wxString::Format(
"%0.1f mm (%0.0f mm)", img->getExifFocalLength(), img->getExifFocalLength35());
544 s = wxString::Format(
"%0.1f mm", img->getExifFocalLength());
557 if (img->getExifAperture() > 0)
559 s = wxString::Format(
"F%.1f", img->getExifAperture());
608 if (img->getExifISO() > 0)
610 s = wxString::Format(
"%0.0f", img->getExifISO());
Convenience functions for SrcPanoImage to use on the image variables.
The pano tools interpolators ported to vigra.
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)
@ INTERP_NEAREST_NEIGHBOUR
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.