39 #include <exiv2/exiv2.hpp>
52 wxString PanoOperation::GetLabel()
78 return images.size()==1;
83 return !images.empty();
91 bool AddImageDialog(wxWindow* parent, std::vector<std::string>& files,
bool& withRaws)
94 wxConfigBase* config = wxConfigBase::Get();
95 wxString path = config->Read(wxT(
"/actualPath"), wxT(
""));
96 wxFileDialog dlg(parent,_(
"Add images"),
99 wxFD_OPEN | wxFD_MULTIPLE | wxFD_FILE_MUST_EXIST | wxFD_PREVIEW, wxDefaultPosition);
100 dlg.SetDirectory(path);
104 if (config->HasEntry(wxT(
"lastImageType")))
106 img_ext = config->Read(wxT(
"lastImageType")).c_str();
108 if (img_ext == wxT(
"all images"))
110 dlg.SetFilterIndex(0);
116 if (img_ext == wxT(
"jpg"))
117 dlg.SetFilterIndex(1);
118 else if (img_ext == wxT(
"tiff"))
119 dlg.SetFilterIndex(2);
120 else if (img_ext == wxT(
"png"))
121 dlg.SetFilterIndex(3);
122 else if (img_ext == wxT(
"hdr"))
123 dlg.SetFilterIndex(4);
124 else if (img_ext == wxT(
"exr"))
125 dlg.SetFilterIndex(5);
126 else if (img_ext == wxT(
"all files"))
127 dlg.SetFilterIndex(6);
131 if (img_ext == wxT(
"all raws"))
132 dlg.SetFilterIndex(1);
133 else if (img_ext == wxT(
"jpg"))
134 dlg.SetFilterIndex(2);
135 else if (img_ext == wxT(
"tiff"))
136 dlg.SetFilterIndex(3);
137 else if (img_ext == wxT(
"png"))
138 dlg.SetFilterIndex(4);
139 else if (img_ext == wxT(
"hdr"))
140 dlg.SetFilterIndex(5);
141 else if (img_ext == wxT(
"exr"))
142 dlg.SetFilterIndex(6);
147 if (dlg.ShowModal() == wxID_OK)
150 wxArrayString Pathnames;
151 dlg.GetPaths(Pathnames);
156 config->Write(wxT(
"/actualPath"), wxPathOnly(Pathnames[0]));
158 config->Write(wxT(
"/actualPath"), dlg.GetDirectory());
163 switch (dlg.GetFilterIndex())
165 case 0: config->Write(wxT(
"lastImageType"), wxT(
"all images"));
break;
166 case 1: config->Write(wxT(
"lastImageType"), wxT(
"jpg"));
break;
167 case 2: config->Write(wxT(
"lastImageType"), wxT(
"tiff"));
break;
168 case 3: config->Write(wxT(
"lastImageType"), wxT(
"png"));
break;
169 case 4: config->Write(wxT(
"lastImageType"), wxT(
"hdr"));
break;
170 case 5: config->Write(wxT(
"lastImageType"), wxT(
"exr"));
break;
171 case 6: config->Write(wxT(
"lastImageType"), wxT(
"all files"));
break;
176 switch (dlg.GetFilterIndex())
178 case 0: config->Write(wxT(
"lastImageType"), wxT(
"all images"));
break;
179 case 1: config->Write(wxT(
"lastImageType"), wxT(
"all raws"));
break;
180 case 2: config->Write(wxT(
"lastImageType"), wxT(
"jpg"));
break;
181 case 3: config->Write(wxT(
"lastImageType"), wxT(
"tiff"));
break;
182 case 4: config->Write(wxT(
"lastImageType"), wxT(
"png"));
break;
183 case 5: config->Write(wxT(
"lastImageType"), wxT(
"hdr"));
break;
184 case 6: config->Write(wxT(
"lastImageType"), wxT(
"exr"));
break;
186 withRaws = dlg.GetFilterIndex() == 1;
190 wxArrayString invalidFiles;
191 for(
unsigned int i=0;i<Pathnames.GetCount(); i++)
195 invalidFiles.Add(Pathnames[i]);
198 if(!invalidFiles.empty())
203 for (
unsigned int i=0; i<Pathnames.GetCount(); i++)
214 return _(
"Add individual images...");
219 std::vector<std::string> files;
220 bool withRaws =
true;
227 if (files.size() == 1)
229 wxMessageDialog message(parent, _(
"You selected only one raw file. This is not recommended.\nAll raw files should be converted at once."),
235 wxICON_EXCLAMATION | wxYES_NO );
236 message.SetYesNoLabels(_(
"Convert anyway"), _(
"Let me select several raw files"));
237 if (message.ShowModal() == wxID_NO)
240 wxCommandEvent newAddEvent(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"action_add_images"));
241 MainFrame::Get()->GetEventHandler()->AddPendingEvent(newAddEvent);
250 if (dlg.ShowModal() == wxID_OK)
270 #if defined EXIV2_VERSION && EXIV2_TEST_VERSION(0,27,99)
271 Exiv2::Image::UniquePtr image;
273 Exiv2::Image::AutoPtr image;
277 image = Exiv2::ImageFactory::open(filename);
283 if (image.get() == 0)
290 image->readMetadata();
292 catch (
const Exiv2::Error& e)
294 std::cerr <<
"Exiv2: Error reading metadata (" << e.what() <<
")" << std::endl;
297 Exiv2::ExifData &exifData = image->exifData();
298 if (exifData.empty())
303 Exiv2::Exifdatum& tag = exifData[
"Exif.Image.DateTime"];
304 const std::string date_time = tag.toString();
308 memset(&when, 0,
sizeof(when));
312 const int a = sscanf(date_time.c_str(),
"%d:%d:%d %d:%d:%d",
313 &when.tm_year, &when.tm_mon, &when.tm_mday,
314 &when.tm_hour, &when.tm_min, &when.tm_sec);
320 when.tm_year -= 1900;
329 stamp = mktime(&when);
330 if (stamp == (time_t)(-1))
339 bool operator()(
const std::string & s1,
const std::string & s2)
345 std::map<std::string, time_t> &
m_time;
350 return _(
"Add time-series of images...");
356 std::vector<std::string> files;
359 bool withRaws =
false;
374 files.push_back(pano.
getImage(i).getFilename());
381 StringToPointerHash filenames;
382 StringToFlagHash preloaded;
383 for(
size_t i=0;i<files.size();i++)
389 wxString path = ::wxPathOnly(file) + wxT(
"/*");
390 file = ::wxFindFirstFile(path);
391 while (!file.IsEmpty())
394 if(vigra::isImage(files[i].c_str()))
398 file = ::wxFindNextFile();
402 DEBUG_INFO(
"found " << filenames.size() <<
" candidate files to search.");
405 StringToPointerHash::iterator found;
406 std::map<std::string, time_t> timeMap;
407 for (found = filenames.begin(); found != filenames.end(); ++found)
409 wxString file = found->first;
414 filenames[file] = stamp;
422 for (found = filenames.begin(); found != filenames.end(); ++found)
424 wxString recruit = found->first;
425 if (preloaded[recruit] == 1)
427 time_t pledge = filenames[recruit];
432 for(
size_t i=0;i<files.size();i++)
439 time_t stamp = filenames[file];
440 if (abs((
int)(pledge - stamp)) < maxtimediff)
443 DEBUG_TRACE(
"Recruited " << recruit.mb_str(wxConvLocal));
445 files.push_back(file);
447 filenames[recruit] = 0;
457 sort(files.begin(), files.end(), spred);
464 _(
"No matching images found."),
470 wxOK | wxICON_INFORMATION, parent);
477 return _(
"Manipulate image variables...");
483 if (dlg.ShowModal() == wxID_OK)
486 if (!expression.empty())
501 return _(
"Remove selected image(s)");
507 for (HuginBase::UIntSet::iterator it = images.begin(); it != images.end(); ++it)
516 return _(
"Anchor this image for position");
528 return _(
"Anchor this image for exposure");
553 return _(
"New lens");
577 return _(
"Change lens...");
583 long nr = wxGetNumberFromUser(
584 _(
"Enter new lens number"),
586 _(
"Change lens number"), 0, 0,
594 for (
const auto& img : images)
596 if (pano.
getImage(img).getSize() != lensImgSize)
598 wxMessageBox(wxString::Format(_(
"Selected images and selected lens have different sizes. All images of the same lens should have the same size.\n\nImage %d has size %dx%d, while lens %d has images with size of %dx%d pixel."),
605 wxICON_EXCLAMATION | wxOK);
626 return _(
"Load lens from lens database");
630 return _(
"Load lens from ini file");
638 if (!
m_fromDatabase && images.size() == 1 && lensImages.size() > 1)
641 if(wxMessageBox(_(
"You selected only one image.\nShould the loaded parameters be applied to all images with the same lens?"),_(
"Question"), wxICON_QUESTION | wxYES_NO)==wxYES)
644 std::copy(lensImages.begin(), lensImages.end(), std::inserter(images, images.end()));
647 vigra::Size2D sizeImg0=pano.
getImage(*(images.begin())).getSize();
649 bool differentImageSize=
false;
650 for(HuginBase::UIntSet::const_iterator it=images.begin();it!=images.end() && !differentImageSize;++it)
652 differentImageSize=(pano.
getImage(*it).getSize()!=sizeImg0);
654 if(differentImageSize)
656 if(wxMessageBox(_(
"You selected images with different sizes.\nApply lens parameter file can result in unwanted results.\nApply settings anyway?"), _(
"Error"), wxICON_QUESTION |wxYES_NO)==wxID_NO)
690 return _(
"Save lens parameters to lens database");
694 return _(
"Save lens to ini file");
700 unsigned int imgNr = *(images.begin());
714 return _(
"Remove control points");
735 for (HuginBase::CPVector::const_iterator it = cps.begin(); it != cps.end(); ++it)
739 cpsToDelete.insert(it - cps.begin());
742 if(cpsToDelete.empty())
744 wxMessageBox(_(
"Selected images have no control points."),
750 wxICON_EXCLAMATION | wxOK);
753 int r =wxMessageBox(wxString::Format(_(
"Really delete %lu control points?"),
754 (
unsigned long int) cpsToDelete.size()),
755 _(
"Delete Control Points"),
756 wxICON_QUESTION | wxYES_NO);
769 return _(
"Clean control points");
787 std::map<size_t,size_t> cpMap;
791 for(
size_t i=0;i<allCPs.size();i++)
796 firstCleanedCP.push_back(cp);
812 if(!removedCP2.empty())
814 for(HuginBase::UIntSet::const_iterator it=removedCP2.begin();it!=removedCP2.end();++it)
816 removedCPs.insert(cpMap[*it]);
825 if (!removedCPs.empty())
827 wxMessageBox(wxString::Format(_(
"Removed %lu control points"), (
unsigned long int)removedCPs.size()), _(
"Cleaning"), wxOK | wxICON_INFORMATION, parent);
835 return _(
"Remove control points on clouds");
844 if (model == NULL || !progress.updateDisplay(_(
"Loading images")))
850 wxConfigBase *cfg = wxConfigBase::Get();
857 int radius=(t)?10:20;
861 for (HuginBase::UIntSet::const_iterator it=images.begin(); it!=images.end(); ++it)
867 if (!progress.updateDisplayValue())
874 vigra::UInt16RGBImage in;
875 if(img->image16->width()>0)
877 in.resize(img->image16->size());
883 in.resize(im8->size());
886 if (!img->iccProfile->empty())
890 if (!progress.updateDisplay(_(
"Running Celeste")))
896 if (!progress.updateDisplay())
902 for(HuginBase::UIntSet::const_iterator it2=cloudCP.begin();it2!=cloudCP.end(); ++it2)
904 cpsToRemove.insert(*it2);
907 if (!progress.updateDisplayValue(_(
"Loading images")))
913 if (!progress.updateDisplayValue())
917 if (!cpsToRemove.empty())
919 wxMessageBox(wxString::Format(_(
"Removed %lu control points"), (
unsigned long int) cpsToRemove.size()), _(
"Celeste result"),wxOK|wxICON_INFORMATION);
956 return _(
"Reset user defined...");
959 return _(
"Reset positions");
962 return _(
"Reset translation parameters");
965 return _(
"Reset lens parameters");
968 return _(
"Reset photometric parameters");
970 return wxEmptyString;
1000 if(fabs(redBalanceAnchor)<1e-2)
1004 if(fabs(blueBalanceAnchor)<1e-2)
1006 blueBalanceAnchor=1;
1010 for(HuginBase::UIntSet::const_iterator it = images.begin(); it != images.end(); ++it)
1012 unsigned int imgNr = *it;
1016 map_get(ImgVars,
"y").setValue(0);
1017 map_get(ImgVars,
"p").setValue(0);
1019 map_get(ImgVars,
"TrX").setValue(0);
1020 map_get(ImgVars,
"TrY").setValue(0);
1021 map_get(ImgVars,
"TrZ").setValue(0);
1022 map_get(ImgVars,
"Tpy").setValue(0);
1023 map_get(ImgVars,
"Tpp").setValue(0);
1027 map_get(ImgVars,
"TrX").setValue(0);
1028 map_get(ImgVars,
"TrY").setValue(0);
1029 map_get(ImgVars,
"TrZ").setValue(0);
1030 map_get(ImgVars,
"Tpy").setValue(0);
1031 map_get(ImgVars,
"Tpp").setValue(0);
1036 double focalLength=srcImg.getExifFocalLength();
1037 double cropFactor=srcImg.getExifCropFactor();
1038 if(focalLength!=0 && cropFactor!=0)
1043 map_get(ImgVars,
"v").setValue(newHFOV);
1049 map_get(ImgVars,
"a").setValue(0);
1050 map_get(ImgVars,
"b").setValue(0);
1051 map_get(ImgVars,
"c").setValue(0);
1052 map_get(ImgVars,
"d").setValue(0);
1053 map_get(ImgVars,
"e").setValue(0);
1054 map_get(ImgVars,
"g").setValue(0);
1055 map_get(ImgVars,
"t").setValue(0);
1065 map_get(ImgVars,
"Eev").setValue(eV);
1071 map_get(ImgVars,
"Eev").setValue(0);
1083 if(img.getExifMake() == anchor.getExifMake() &&
1084 img.getExifModel() == anchor.getExifModel())
1086 redBal=fabs(img.getExifRedBalance()/redBalanceAnchor);
1091 blueBal=fabs(img.getExifBlueBalance()/blueBalanceAnchor);
1097 map_get(ImgVars,
"Er").setValue(redBal);
1098 map_get(ImgVars,
"Eb").setValue(blueBal);
1102 map_get(ImgVars,
"Er").setValue(1);
1103 map_get(ImgVars,
"Eb").setValue(1);
1108 map_get(ImgVars,
"Vb").setValue(0);
1109 map_get(ImgVars,
"Vc").setValue(0);
1110 map_get(ImgVars,
"Vd").setValue(0);
1111 map_get(ImgVars,
"Vx").setValue(0);
1112 map_get(ImgVars,
"Vy").setValue(0);
1117 map_get(ImgVars,
"Ra").setValue(0);
1118 map_get(ImgVars,
"Rb").setValue(0);
1119 map_get(ImgVars,
"Rc").setValue(0);
1120 map_get(ImgVars,
"Rd").setValue(0);
1121 map_get(ImgVars,
"Re").setValue(0);
1123 vars.push_back(ImgVars);
1125 std::vector<PanoCommand::PanoCommand *> reset_commands;
1126 reset_commands.push_back(
1140 bool checkGeometric;
1141 bool checkPhotometric;
1146 checkGeometric=
true;
1147 checkPhotometric=
false;
1151 checkGeometric=
false;
1152 checkPhotometric=
true;
1156 checkGeometric=
true;
1157 checkPhotometric=
true;
1160 if(reset_dlg.ShowModal()==wxID_OK)
1169 if(checkPhotometric)
1227 return _(
"New stack");
1251 return _(
"Change stack...");
1257 long nr = wxGetNumberFromUser(
1258 _(
"Enter new stack number"),
1260 _(
"Change stack number"), 0, 0,
1268 for (
const auto& img : images)
1270 if (pano.
getImage(img).getSize() != stackImgSize)
1272 wxMessageBox(wxString::Format(_(
"Selected images and selected stack have different sizes. All images of the same stack should have the same size.\n\nImage %d has size %dx%d, while stack %d has images with size of %dx%d pixel."),
1279 wxICON_EXCLAMATION | wxOK);
1299 return _(
"Set stack size...");
1304 wxConfigBase* cfg = wxConfigBase::Get();
1306 wxXmlResource::Get()->LoadDialog(&dlg, parent, wxT(
"stack_size_dialog"));
1307 wxSpinCtrl* stackSpin = XRCCTRL(dlg,
"stack_size_spinctrl", wxSpinCtrl);
1309 size_t oldStackSize = cfg->Read(wxT(
"/StackDialog/StackSize"), 3);
1311 stackSpin->SetValue(oldStackSize);
1312 wxCheckBox* linkCheckBox = XRCCTRL(dlg,
"stack_size_link_checkbox", wxCheckBox);
1313 linkCheckBox->SetValue(cfg->Read(wxT(
"/StackDialog/LinkPosition"),
true) != 0
l);
1314 if (dlg.ShowModal() != wxID_OK)
1319 long stackSize = stackSpin->GetValue();
1320 bool linkPosition = linkCheckBox->IsChecked();
1321 cfg->Write(wxT(
"/StackDialog/StackSize"), stackSize);
1322 cfg->Write(wxT(
"/StackDialog/LinkPosition"), linkPosition);
1327 std::vector<PanoCommand::PanoCommand *> commands;
1347 for(
size_t i=0; i<stackSize && imgNr<pano.
getNrOfImages(); i++)
1357 if (!linkPosition && stackSize > 1)
1362 std::set<HuginBase::ImageVariableGroup::ImageVariableEnum> variables;
1363 variables.insert(HuginBase::ImageVariableGroup::IVE_Yaw);
1364 variables.insert(HuginBase::ImageVariableGroup::IVE_Pitch);
1365 variables.insert(HuginBase::ImageVariableGroup::IVE_Roll);
1366 variables.insert(HuginBase::ImageVariableGroup::IVE_X);
1367 variables.insert(HuginBase::ImageVariableGroup::IVE_Y);
1368 variables.insert(HuginBase::ImageVariableGroup::IVE_Z);
1369 variables.insert(HuginBase::ImageVariableGroup::IVE_TranslationPlaneYaw);
1370 variables.insert(HuginBase::ImageVariableGroup::IVE_TranslationPlanePitch);
1442 for(
size_t i=0; i<vec.size(); i++)
Base class for all panorama commands.
virtual bool IsEnabled(HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
return true, if operation is enabled with the given image set
virtual wxString GetLabel()
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
bool GetResetLens()
Return TRUE, when user selected "Reset lens".
static const std::set< ConstImageVariableGroup::ImageVariableEnum > & getLensVariables()
Get the set of lens image variables.
vigra::Size2D getImageSize() const
get the image size, in pixels
update variables of a group of images
virtual bool IsEnabled(HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
return true, if operation is enabled with the given image set
PanoOperation to change anchor image.
virtual wxString GetLabel()
virtual bool IsEnabled(HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
return true, if operation is enabled with the given image set
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
PanoOperation to clean control points with Celeste.
virtual wxString GetLabel()
virtual wxString GetLabel()
bool updateDisplayValue(const wxString &message, const wxString &filename=wxEmptyString)
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
unsigned int getPartNumber(unsigned int imageNr) const
Get a part number from an image number.
virtual wxString GetLabel()
Change the linking of some variables across parts of an ImageVariableGroup containing some specified ...
bool AddImageDialog(wxWindow *parent, std::vector< std::string > &files, bool &withRaws)
small function to show add image dialog
SrcPanoImage getSrcImage(unsigned imgNr) const
get a description of a source image
bool m_resetCameraResponse
Dialog for reset panorama settings.
PanoOperation to change exposure anchor image.
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
PanoOperation to save lens to ini file or database.
PanoOperation to assign new stack.
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 ...
static PanoOperationVector PanoOpImages
ImageVariableGroup & getStacks()
Get the ImageVariableGroup representing the group of stack variables.
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
virtual wxString GetLabel()
void registerPTWXDlgFcn()
virtual wxString GetLabel()
bool IsConnected()
check if all images are connected
PanoOperation to assigns stacks.
bool GetResetExposure()
Return TRUE, when user selected "Reset exposure".
static PanoOperationVector PanoOpReset
virtual bool IsEnabled(HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
return true, if operation is enabled with the given image set
PanoOperation to assign new lens.
ResetOperation(ResetMode newResetMode)
void deregisterPTWXDlgFcn()
std::size_t getNrOfCtrlPoints() const
number of control points
void LimitToPhotometric()
limits the displayed parameters to photometric parameters
bool set_contains(const _Container &c, const typename _Container::key_type &key)
double calcExifExposureValue()
calculate exposure value
const CPVector & getCtrlPoints() const
get all control point of this Panorama
int getHeight() const
Get the height of the image in pixels.
void GeneratePanoOperationVector()
generates the PanoOperationVector for context menu
static ImageCache & getInstance()
get the global ImageCache object
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
remove several control points
represents a control point
Definition of PanoOperation class.
unsigned int colorReferenceImage
bool GetResetFOV()
Return TRUE, when user selected "Reset FOV".
static PanoOperationVector PanoOpStacks
Definition of ResetDialog class.
bool GetResetExposureToExif()
Return TRUE, when user selected "Reset exposure to EXIF", Return FALSE, when user selected "Reset exp...
PanoCommand to combine other PanoCommands.
PanoOperation to remove selected images.
Panorama duplicate() const
duplicate the panorama
std::set< unsigned int > UIntSet
bool GetResetColor()
Return TRUE, when user selected "Reset color".
std::vector< VariableMap > VariableMapVector
options getSize().area()) int wxCALLBACK SortFieldOfViewAscending(wxIntPtr item1
algorithms for remove control points by statistic method
virtual bool IsEnabled(HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
return true, if operation is enabled with the given image set
virtual wxString GetLabel()
bool GetResetVignetting()
Return TRUE, when user selected "Reset vignetting".
#define HUGIN_CAPTURE_TIMESPAN
UIntSetVector getPartsSet() const
return a vector which contains a HuginBase::UIntSet for each group with the corresponding images numb...
Definition of dialog and functions to import RAW images to project file.
std::shared_ptr< Entry > EntryPtr
a shared pointer to the entry
Make a new part in a ImageVariableGroup for a set of images, given the variables that make up the gro...
std::map< std::string, time_t > & m_time
const VariableMap getImageVariables(unsigned int imgNr) const
Get the variables of an image.
PanoCommand::PanoCommand * GetPanoCommand()
return PanoCommand for adding converted raw files to Panorama
std::string GetExpression()
std::size_t getNrOfImages() const
number of images.
static MainFrame * Get()
hack.. kind of a pseudo singleton...
void LimitToGeometric()
limits the displayed parameters to geometric parameters
UIntSet getCPoutsideLimit_pair(Panorama pano, AppBase::ProgressDisplay &progress, double n)
optimises images pairwise and removes for every image pair control points with error > mean+n*sigma ...
void setCtrlPoints(const CPVector &points)
set all control points (Ippei: Is this supposed to be 'add' method?)
Map::mapped_type & map_get(Map &m, const typename Map::key_type &key)
get a map element.
std::shared_ptr< vigra::BRGBImage > ImageCacheRGB8Ptr
use reference counted pointers
#define HUGIN_CELESTE_FILTER
int getWidth() const
Get the width of the image in pixels.
virtual wxString GetLabel()
PanoOperationVector * GetLensesOperationVector()
returns list of PanoOperation for work with lenses
#define HUGIN_CELESTE_THRESHOLD
Switch the part number of an image.
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
virtual bool IsEnabled(HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
return true, if operation is enabled with the given image set
PanoOperationVector * GetControlPointsOperationVector()
returns list of PanoOperation for work with control points
PanoOperation to load lens from ini file or lens database.
base class for different PanoOperations derived classes should overwrite protected PanoOperation::Get...
Definition of dialog to edit image variables by parsing an expression.
PanoOperation to add several user selected images to the panorama.
time_t ReadExifTime(const char *filename)
reset output exposure to mean exposure of all images
ImageVariableGroup & getLenses()
Get the ImageVariableGroup representing the group of lens variables.
static PanoOperationVector PanoOpControlPoints
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
wxwindows specific panorama commands
virtual wxString GetLabel()
PanoOperation to remove control points.
virtual wxString GetLabel()
update variables by parsing a expression
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
vigra::pair< typename ROIImage< Image, Alpha >::image_traverser, typename ROIImage< Image, Alpha >::ImageAccessor > destImage(ROIImage< Image, Alpha > &img)
virtual bool IsEnabled(HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
return true, if operation is enabled with the given image set
CPointVector getCtrlPointsVectorForImage(unsigned int imgNr) const
return a vector of std::pairs with global ctrl point nr and ControlPoint In the class ControlPoint th...
vigra::triple< typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::ImageConstAccessor > srcImageRange(const ROIImage< Image, Mask > &img)
helper function for ROIImages
Dialog for editing expression to change image variables.
virtual wxString GetLabel()
dialogs for loading and saving information from/to lens database
std::vector< CPoint > CPointVector
PanoOperation to change lens number.
WX_DECLARE_STRING_HASH_MAP(time_t, StringToPointerHash)
bool GetResetColorToExif()
Return TRUE, when user selected "Reset color to EXIF", Return FALSE, when user selected "Reset color ...
std::map< std::string, Variable > VariableMap
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.
virtual bool IsEnabled(HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
return true, if operation is enabled with the given image set
virtual wxString GetLabel()
struct celeste::svm_model * GetSVMModel()
PanoOperation to add all image in a defined timeinterval to the panorama.
EntryPtr getImage(const std::string &filename)
get a image.
static PanoOperationVector PanoOpLens
const PanoramaOptions & getOptions() const
returns the options for this panorama
HuginBase::UIntSet getCelesteControlPoints(struct svm_model *model, vigra::UInt16RGBImage &input, HuginBase::CPointVector cps, int radius, float threshold, int resize_dimension, bool verbose)
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)=0
main working function, overwrite it in derived classes
UIntSet getCPoutsideLimit(Panorama pano, double n, bool skipOptimisation, bool includeLineCp)
optimises the whole panorama and removes all control points with error > mean+n*sigma ...
sortbytime(std::map< std::string, time_t > &h)
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
bool operator()(const std::string &s1, const std::string &s2)
virtual bool IsEnabled(HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
return true, if operation is enabled with the given image set
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
virtual bool IsEnabled(HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
return true, if operation is enabled with the given image set
PanoOperation to reset image variables.
virtual bool IsEnabled(HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
return true, if operation is enabled with the given image set
add image(s) to a panorama
bool ShowDialog(wxWindow *parent)
virtual wxString GetLabel()
PanoOperationVector * GetResetOperationVector()
returns list of PanoOperation for resetting
PanoOperationVector * GetImagesOperationVector()
returns list of PanoOperation for work with images
std::vector< ControlPoint > CPVector
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
void transformImage(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor &func)
PanoOperation to clean control points with statistically method.
void copyImage(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc)
LoadLensOperation(bool fromDatabase)
virtual bool IsEnabled(HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
return true, if operation is enabled with the given image set
std::vector< PanoOperation * > PanoOperationVector
bool updateDisplay(const wxString &message)
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
remove multiple images from a panorama
void CleanPanoOperationVector()
clears the PanoOperationVector
void fill_set(_Container &c, typename _Container::key_type begin, typename _Container::key_type end)
SaveLensOperation(bool toDatabase)
bool GetResetTranslation()
Return TRUE, when user selected "Reset translation".
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
std::size_t getNumberOfParts() const
get the number of parts.
All variables of a source image.
void removeImage(const std::string &filename)
remove a specific image (and dependant images) from the cache
PanoOperationVector * GetStacksOperationVector()
returns list of PanoOperation for stacks
bool GetResetResponse()
Return TRUE, when user selected "Reset Camera Response".
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
bool GetResetPos()
Return TRUE, when user selected "Reset position".
void _CleanPanoOperationVector(PanoOperationVector &vec)
functions to handle icc profiles in images
virtual wxString GetLabel()
static const std::set< ConstImageVariableGroup::ImageVariableEnum > & getStackVariables()
Get the set of stack image variables.
virtual PanoCommand::PanoCommand * GetInternalCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images)
main working function, overwrite it in derived classes
PanoOperation to modify image variables by parsing an expression.
void ApplyICCProfile(ImageType &image, const vigra::ImageImportInfo::ICCProfile &iccProfile, const cmsUInt32Number imageFormat)
converts given image with iccProfile to sRGB/gray space, need to give pixel type in lcms2 format work...
virtual wxString GetLabel()
PanoOperation to change lens number.
virtual wxString GetLabel()
bool CheckRawFiles()
return true, if all raw files are from the same camera
Lens getLens(std::size_t lens_number)
A panorama.getLens equivalent, not for new code.
unsigned int optimizeReferenceImage
class to work with images graphs created from a HuginBase::Panorama class it creates a graph based on...