27#include "hugin_config.h"
69 wxXmlResource::Get()->LoadPanel(
this,
"optimize_panel");
70 wxPanel *
panel =
XRCCTRL(*
this,
"optimize_panel", wxPanel);
158 hugin_utils::HuginMessageBox(
_(
"The project does not contain any active images.\nPlease activate at least one image in the (fast) preview window.\nOptimization canceled."),
181 if (
optPano.getNrOfCtrlPoints() == 0)
183 hugin_utils::HuginMessageBox(
_(
"There are no control points in the current configuration for the optimizer.\nPlease add control points before running the optimizer.\nOptimization canceled."),
253 hugin_utils::HuginMessageBox(
_(
"There are no control points in the current configuration for the optimizer.\nPlease add control points before running the optimizer.\nOptimization canceled."),
266 wxXmlResource::Get()->LoadDialog(&
edit_dlg,
this,
"edit_script_dialog");
332 for (HuginBase::VariableMapVector::const_iterator
it = vars.begin();
it != vars.end(); ++
it)
344 msg.Printf(
_(
"Optimizer run finished.\nWARNING: a very small Field of View (v) has been estimated\n\nThe results are probably invalid.\n\nOptimization of the Field of View (v) of partial panoramas can lead to bad results.\nTry adding more images and control points.\n\nApply the changes anyway?"));
351 msg.Printf(
_(
"Optimizer run finished.\nResults:\n average control point distance: %f\n standard deviation: %f\n maximum: %f\n\n*WARNING*: very high distortion coefficients (a,b,c) have been estimated.\nThe results are probably invalid.\nOnly optimize all distortion parameters when many, well spread control points are used.\nPlease reset the a,b and c parameters to zero and add more control points\n\nApply the changes anyway?"),
357 msg.Printf(
_(
"Optimizer run finished.\nResults:\n average control point distance: %f\n standard deviation: %f\n maximum: %f\n\nApply the changes?"),
420 : wxXmlResourceHandler()
431 GetPosition(), GetSize(),
declaration of main image tree control
some definitions to work with optimizer master switches
!! from PTOptimise.h 1951
void registerPTWXDlgFcn()
void deregisterPTWXDlgFcn()
Definition of PanoOperation class.
static void calcCtrlPntsErrorStats(const PanoramaData &pano, double &min, double &max, double &mean, double &var, const int &imgNr=-1, const bool onlyActive=false, const bool ignoreLineCp=false)
virtual void run()
runs the algorithm.
void setProjection(ProjectionFormat f)
set the Projection format and adjust the hfov/vfov if nessecary
PanoramaOptions::ProjectionFormat getProjection() const
void addObserver(PanoramaObserver *o)
add a panorama observer.
VariableMapVector getVariables() const
get variables of this panorama
Panorama getSubset(const UIntSet &imgs) const
get a subset of the panorama
bool removeObserver(PanoramaObserver *observer)
remove a panorama observer.
const int getOptimizerSwitch() const
returns optimizer master switch
UIntSet getActiveImages() const
get active images
std::size_t getNrOfImages() const
number of images.
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
void SetOptimizerMode()
sets to control into optimizer mode
void SetDisplayMode(DisplayMode newMode)
sets the display mode to given mode
void MarkActiveImages(const bool markActive)
sets the flag, if active/disabled image should be marked with different colour
static MainFrame * Get()
hack.. kind of a pseudo singleton...
const GuiLevel GetGuiLevel() const
void SetOptimizeIgnoreLineCp(const bool ignoreLineCP)
sets the status of the "ignore line cp" menu item
void SetOptimizeOnlyActiveImages(const bool onlyActive)
sets the status of the "optimize only active images" menu item
virtual wxObject * DoCreateResource()
virtual bool CanHandle(wxXmlNode *node)
HuginBase::Panorama * m_pano
void SetGuiLevel(GuiLevel newGuiLevel)
bool AskApplyResult(wxWindow *activeWindow, const HuginBase::Panorama &pano)
virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
receives notification about panorama changes
void OnCheckOnlyActiveImages(wxCommandEvent &e)
handle "only active images" checkbox
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
Delayed creation.
void OnClose(wxCloseEvent &e)
void SetOnlyActiveImages(const bool onlyActive)
for external setting of "only active image" checkbox
void OnOptimizeButton(wxCommandEvent &e)
run the optimizer
void Init(HuginBase::Panorama *pano)
void runOptimizer(const HuginBase::UIntSet &img, const bool ignoreLineCp)
wxCheckBox * m_ignore_line_cp
virtual void panoramaChanged(HuginBase::Panorama &pano)
receives notification about panorama changes
wxCheckBox * m_only_active_images_cb
ImagesTreeCtrl * m_images_tree_list
void OnCheckIgnoreLineCP(wxCommandEvent &e)
handle "ignore line cp" checkbox
void SetIgnoreLineCP(const bool noLineCp)
for external setting of "ignore line cp" checkbox
ImagesTreeCtrl * m_lens_tree_list
void OnReset(wxCommandEvent &e)
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
static GlobalCmdHist & getInstance()
Base class for all panorama commands.
update all variables & control points
virtual PanoCommand::PanoCommand * GetCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
returns the appropriate PanoCommand::PanoCommand to be inserted into GlobalCmdHistory,...
PanoOperation to reset image variables.
helper class, it disables the control/window in the constructor and automatically enables it back in ...
#define DEBUG_ASSERT(cond)
std::vector< VariableMap > VariableMapVector
std::vector< ControlPoint > CPVector
std::set< unsigned int > UIntSet
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)
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.