28#include "hugin_config.h"
70 wxXmlResource::Get()->LoadPanel(
this,
"images_panel");
71 wxPanel *
panel =
XRCCTRL(*
this,
"images_panel", wxPanel);
173 if(
cb->HasClientUntypedData())
175 for(
size_t i = 0;
i <
cb->GetCount();
i++)
177 delete static_cast<int*
>(
cb->GetClientData(
i));
188 m_maxEv->PopEventHandler(
true);
218 if(optSwitch==*
static_cast<int*
>(
m_optChoice->GetClientData(
i)))
319 _(
"Enter maximal number of control points per image pair"),
320 _(
"Points per Overlap"),
321 _(
"Control point detector option"),
367 img.getCropFactor(),img.getSize());;
368 double cropFactor=img.getCropFactor();
369 for (HuginBase::UIntSet::const_iterator
it =
sel.begin();
it !=
sel.end(); ++
it)
372 if(proj!=img2.getProjection())
377 img2.getCropFactor(),img2.getSize());
382 if(
fabs(cropFactor-img2.getCropFactor())>0.1)
458 ImageCache::EntryPtr
cacheEntry = ImageCache::getInstance().getSmallImageIfAvailable(
477 double iRatio = img.GetWidth() / (
double) img.GetHeight();
495 if (std::max(img.GetWidth(), img.GetHeight()) > (
ULONG_MAX >> 16))
507 vigra::ImageImportInfo::ICCProfile iccProfile;
541 std::vector<PanoCommand::PanoCommand*> commands;
548 if (wxConfig::Get()->Read(
"/ShowFisheyeCropHint", 1l) == 1 &&
556 wxXmlResource::Get()->LoadDialog(&
dlg,
NULL,
"fisheye_show_crop_dlg");
563 wxConfig::Get()->Write(
"/ShowFisheyeCropHint", 0l);
601 wxString::Format(
_(
"You have given a field of view of %.2f degrees.\n But the orthographic projection is limited to a field of view of 180 degress.\nDo you want still use that high value?"), hfov),
657 if(
fabs(val)<0.001 || val>1)
729 wxCommandEvent
dummy;
739 m_optChoice->Append(
_(
"Positions (incremental, starting from anchor)"),
i);
748 m_optChoice->Append(
_(
"Positions and Barrel Distortion (y,p,r,b)"),
i);
751 m_optChoice->Append(
_(
"Positions, View and Barrel (y,p,r,v,b)"),
i);
766 m_optChoice->Append(
_(
"Positions and Translation (y,p,r,x,y,z)"),
i);
769 m_optChoice->Append(
_(
"Positions, Translation and View (y,p,r,x,y,z,v)"),
i);
772 m_optChoice->Append(
_(
"Positions, Translation and Barrel (y,p,r,x,y,z,b)"),
i);
775 m_optChoice->Append(
_(
"Positions, Translation, View and Barrel (y,p,r,x,y,z,v,b)"),
i);
796 m_optPhotoChoice->Append(
_(
"High dynamic range, variable white balance, fixed exposure"),
i);
891 : wxXmlResourceHandler()
902 GetPosition(), GetSize(),
wxString GetDataPath()
return path to data directory, it depends on operating system
void DeleteClientData(wxChoice *cb)
declaration of main image tree control
some definitions to work with optimizer master switches
Somewhere to specify what variables belong to what.
Base class for control point creators.
virtual HuginBase::CPVector automatch(CPDetectorSetting &setting, HuginBase::Panorama &pano, const HuginBase::UIntSet &imgs, int nFeatures, int &ret_value, wxWindow *parent=NULL)
Do cp matching, calles the right routines, based on the matcher selected.
void FillControl(wxControlWithItems *control, bool select_default=false, bool show_default=false)
fills a wxControlWithItems with the available generators
void Read(wxConfigBase *config=wxConfigBase::Get(), wxString loadFromFile=wxEmptyString)
read the settings of different cp generators from config
void Write(wxConfigBase *config=wxConfigBase::Get())
writes the settings of different cp generators to config
ArraySettings settings
array which stores the different autopano settings
class, which stores all settings of one cp detector
double outputStacksMinOverlap
double outputLayersExposureDiff
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 addObserver(PanoramaObserver *o)
add a panorama observer.
const int getPhotometricOptimizerSwitch() const
return the photometric optimizer master switch
bool removeObserver(PanoramaObserver *observer)
remove a panorama observer.
const int getOptimizerSwitch() const
returns optimizer master switch
std::size_t getNrOfImages() const
number of images.
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
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
virtual bool CanHandle(wxXmlNode *node)
virtual wxObject * DoCreateResource()
void OnFocalLengthChanged(wxCommandEvent &e)
updates the focal length for the selected images
wxStaticBitmap * m_smallImgCtrl
pointer to the preview image control
void OnLensTypeChanged(wxCommandEvent &e)
updates the lens type for the selected images
void OnMinimumOverlapChanged(wxCommandEvent &e)
updates the minimum overlap
void OnPhotometricOptimizerSwitchChanged(wxCommandEvent &e)
event handler, when photometric optimizer master switch was changed
void OnGroupModeChanged(wxCommandEvent &e)
event handler when grouping selection was changed
wxChoice * m_CPDetectorChoice
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
wxString GetCurrentOptimizerString()
return the currently selected optimizer setting as string from the drop down list box
void RunCPGenerator(CPDetectorSetting &setting, const HuginBase::UIntSet &img)
run the cp generator with the given setting on selected images
wxChoice * m_groupModeChoice
HuginBase::ImageCache::RequestPtr thumbnail_request
Request for thumbnail image.
void CPGenerate(wxCommandEvent &e)
control point detection event handler
wxButton * m_matchingButton
wxBitmap m_empty
bitmap with default image
wxChoice * m_optChoice
pointer to optimizer switch selector
void SetGuiLevel(GuiLevel newGuiLevel)
sets the GuiLevel for all controls on this panel
void OnCropFactorChanged(wxCommandEvent &e)
updates the crop factor for the selected images
virtual void panoramaChanged(HuginBase::Panorama &pano)
this is called whenever the panorama has changed.
wxTextCtrl * m_focallength
the text input control for focal length
wxChoice * m_optPhotoChoice
pointer to photometric optimizer switch selector
virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
notifies about changes to images
void UpdatePreviewImage()
void OnSize(wxSizeEvent &e)
void FillOptimizerChoice()
fills the optmizer wxChoices with values depending on GuiLevel
void OnSelectionChanged(wxTreeEvent &e)
change displayed variables if the selection has changed.
wxChoice * m_lenstype
pointer to lens type selector
void OnOptimizeButton(wxCommandEvent &e)
event handler for geometric optimizer
CPDetectorConfig cpdetector_config
void ReloadCPDetectorSettings()
Reloads the cp detector settings from config, necessary after edit preferences.
void OnOptimizerSwitchChanged(wxCommandEvent &e)
event handler, when optimizer master switch was changed
void FillGroupChoice()
fills the grouping wxChoice with values depending on GuiLevel
HuginBase::Panorama * m_pano
the model
wxTextCtrl * m_maxEv
the text input control for max ev difference
wxTextCtrl * m_cropfactor
the text input control for crop factor
void OnDisplayModeChanged(wxCommandEvent &e)
event handler when display mode (which information should be shown) was changed
void OnMaxEvDiffChanged(wxCommandEvent &e)
updates the max ev difference
void ShowImage(unsigned int imgNr)
show a bigger thumbnail
ImagesTreeCtrl * m_images_tree
pointer to the main control
const wxString GetSelectedCPGenerator()
return the currently selected cp generator description
void Init(HuginBase::Panorama *pano)
wxTextCtrl * m_overlap
the text input control for minimum overlap
void OnPhotometricOptimizeButton(wxCommandEvent &e)
event handler for photometric optimizer
the main images tree control, used on images and optimizer tabs
HuginBase::UIntSet GetSelectedImages()
returns the selected images
void SetGuiLevel(GuiLevel newSetting)
sets the GuiLevel of the control
void Init(HuginBase::Panorama *pano)
initialization, connects all control with Panorama, register observer
void SetGroupMode(GroupMode newMode)
sets the group mode to given mode
GroupMode
enumeration for grouping mode
void SetDisplayMode(DisplayMode newMode)
sets the display mode to given mode
DisplayMode
enumeration for display mode, limits the displayed columns
static MainFrame * Get()
hack.. kind of a pseudo singleton...
void OnPhotometricOptimize(wxCommandEvent &e)
void ShowMaskEditor(size_t imgNr, bool switchToCropMode=false)
opens the mask/crop editor with the given image selected
void OnOptimize(wxCommandEvent &e)
add multiple control points
PanoCommand to combine other PanoCommands.
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
static GlobalCmdHist & getInstance()
update the optimizer master switch
update the photometric optimizer master switch
Handle EVT_KILL_FOCUS and convert it to a EVT_TEXT_ENTER event.
bool HasMonitorProfile() const
return true if we found a suitable monitor profile and could loading it
static huginApp * Get()
hack.. kind of a pseudo singleton...
helper class, it disables the control/window in the constructor and automatically enables it back in ...
#define HUGIN_ASS_NCONTROLPOINTS
#define DEBUG_ASSERT(cond)
void CorrectImage(wxImage &image, const vigra::ImageImportInfo::ICCProfile &iccProfile, const cmsHPROFILE &monitorProfile)
apply color correction to given image using input iccProfile and monitor profile
std::vector< ControlPoint > CPVector
std::set< unsigned int > UIntSet
bool str2double(const wxString &s, double &d)
wxString doubleTowxString(double d, int digits)
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
include file for the hugin project
include file for the hugin project
void fill_set(_Container &c, typename _Container::key_type begin, typename _Container::key_type end)
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.
wxImage imageCacheEntry2wxImage(ImageCache::EntryPtr e)