57 void OnOk(wxCommandEvent & e);
75 wxXmlResource::Get()->LoadDialog(
this,
parent,
"load_lens_dlg");
82 config->Read(
"/LoadLensDialog/loadDistortion", &b,
true);
86 config->Read(
"/LoadLensDialog/loadVignetting", &b,
true);
107 s = wxString::Format(
_(
"Camera %s (%s)"),
cam.c_str(),
s.BeforeFirst(
'|').c_str());
125 wxCommandEvent
dummy;
205 wxString val =
XRCCTRL(*
this,
"load_lens_aperture", wxTextCtrl)->GetValue().Trim();
217 val =
XRCCTRL(*
this,
"load_lens_distance", wxTextCtrl)->GetValue().Trim();
250 dlg.SetFocalLength(img.getExifFocalLength());
251 dlg.SetAperture(img.getExifAperture());
252 dlg.SetSubjectDistance(img.getExifDistance());
256 const double focal=
dlg.GetFocalLength();
258 std::vector<PanoCommand::PanoCommand*>
cmds;
262 cmds.push_back(
new PanoCommand::ChangeImageProjectionCmd(*pano,images,proj));
268 cmds.push_back(
new PanoCommand::ChangeImageCropRectCmd(*pano, images,
cropRect));
271 if(
dlg.GetLoadDistortion())
279 std::set<HuginBase::ImageVariableGroup::ImageVariableEnum>
linkedVariables;
283 cmds.push_back(
new PanoCommand::ChangeImageHFOVCmd(*pano, images,
newFov));
285 std::vector<double>
dist;
288 if (
dist.size() == 3)
291 std::set<HuginBase::ImageVariableGroup::ImageVariableEnum>
linkedVariables;
292 linkedVariables.insert(HuginBase::ImageVariableGroup::IVE_RadialDistortion);
295 cmds.push_back(
new PanoCommand::ChangeImageRadialDistortionCmd(*pano, images,
dist));
299 if(
dlg.GetLoadVignetting())
301 std::vector<double>
vig;
306 std::set<HuginBase::ImageVariableGroup::ImageVariableEnum>
linkedVariables;
307 linkedVariables.insert(HuginBase::ImageVariableGroup::IVE_RadialVigCorrCoeff);
310 cmds.push_back(
new PanoCommand::ChangeImageRadialVigCorrCoeffCmd(*pano, images,
vig));
345 void OnOk(wxCommandEvent & e);
360 wxXmlResource::Get()->LoadDialog(
this,
parent,
"save_lens_dlg");
366 config->Read(
"/SaveLensDialog/saveDistortion",&b,
true);
370 config->Read(
"/SaveLensDialog/saveVignetting",&b,
true);
487 wxString val =
XRCCTRL(*
this,
"save_lens_aperture", wxTextCtrl)->GetValue().Trim();
499 val =
XRCCTRL(*
this,
"save_lens_distance", wxTextCtrl)->GetValue().Trim();
534 lensDlg.SetCameraMaker(img.getExifMake());
535 lensDlg.SetCameraModel(img.getExifModel());
537 lensDlg.SetFocalLength(img.getExifFocalLength());
538 lensDlg.SetAperture(img.getExifAperture());
539 lensDlg.SetSubjectDistance(img.getExifDistance());
542 lensDlg.DeactivateSaveVignetting();
558 if (img.getExifCropFactor() < 0.1 && !
camMaker.empty() && !
camModel.empty())
562 if (
lensDlg.GetSaveDistortion())
578 if(
lensDlg.GetSaveVignetting())
Declare the ImageVariableGroup and ImageVariableGroupObserver classes.
Convenience functions for SrcPanoImage to use on the image variables.
class to access Hugins camera and lens database
static const std::set< ConstImageVariableGroup::ImageVariableEnum > & getLensVariables()
Get the set of lens image variables.
static LensDB & GetSingleton()
returns the static LensDB instance
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
All variables of a source image.
static double calcFocalLength(SrcPanoImage::Projection proj, double hfov, double crop, vigra::Size2D imageSize)
calcualte focal length, given crop factor and hfov
std::string getDBLensName() const
constructs the lens name for the database it is the lensname if known, for compact cameras it is cons...
bool isCircularCrop() const
returns true, if projection requires cicular crop
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
dialog for loading lens parameter from lens database
void SetSubjectDistance(double distance)
double GetSubjectDistance() const
wxCheckBox * m_loadDistortion
std::string GetLensName() const
void SetFocalLength(double focal)
wxCheckBox * m_loadVignetting
bool GetLoadVignetting() const
void SetLensName(std::string lensname)
HuginBase::LensDB::LensList m_lensNames
double GetFocalLength() const
double GetAperture() const
void OnOk(wxCommandEvent &e)
Saves current state of all checkboxes when closing dialog with Ok.
bool GetLoadDistortion() const
void OnCheckChanged(wxCommandEvent &e)
void SetAperture(double aperture)
LoadLensDBDialog(wxWindow *parent)
Constructor, read from xrc ressource; restore last uses settings, size and position.
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.
dialog for saving lens parameter into lens database
void SetSubjectDistance(double distance)
bool GetSaveDistortion() const
void DeactivateSaveVignetting()
void SetFocalLength(double focal)
void SetLensName(std::string lensname)
void OnOk(wxCommandEvent &e)
Saves current state of all checkboxes when closing dialog with Ok.
double GetAperture() const
std::string GetCameraMaker() const
void SetCameraMaker(std::string maker)
std::string GetLensName() const
std::string GetCameraModel() const
double GetSubjectDistance() const
SaveLensDBDialog(wxWindow *parent)
Constructor, read from xrc ressource; restore last uses settings, size and position.
double GetFocalLength() const
bool GetSaveVignetting() const
wxCheckBox * m_saveDistortion
std::string GetLensMaker() const
wxCheckBox * m_saveVignetting
void SetCameraModel(std::string model)
void OnCheckChanged(wxCommandEvent &e)
void SetAperture(double aperture)
std::vector< std::string > LensList
vector storing a list of lens names
std::set< unsigned int > UIntSet
wxString doubleTowxString(double d, int digits)
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
bool stringToDouble(const STR &str_, double &dest)
convert a string to a double, ignore localisation.
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
include file for the hugin project
include file for the hugin project
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.
bool ApplyLensDBParameters(wxWindow *parent, HuginBase::Panorama *pano, HuginBase::UIntSet images, PanoCommand::PanoCommand *&cmd)
loads the lens parameters from lens database and create approbiate PanoCommand::PanoCommand to apply ...
bool str2double(wxWindow *parent, wxString s, double &d)
bool SaveLensParameters(wxWindow *parent, const HuginBase::SrcPanoImage &img, bool includeVignetting)
saves the lensparameter of the given HuginBase::SrcPanoImage into the lens database
dialogs for loading and saving information from/to lens database