40 #include <exiv2/exiv2.hpp>
53 wxString PanoOperation::GetLabel()
79 return images.size()==1;
84 return !images.empty();
92 bool AddImageDialog(wxWindow* parent, std::vector<std::string>& files,
bool& withRaws)
95 wxConfigBase* config = wxConfigBase::Get();
96 wxString path = config->Read(
"/actualPath", wxEmptyString);
97 wxFileDialog dlg(parent,_(
"Add images"),
100 wxFD_OPEN | wxFD_MULTIPLE | wxFD_FILE_MUST_EXIST | wxFD_PREVIEW, wxDefaultPosition);
101 dlg.SetDirectory(path);
105 if (config->HasEntry(
"lastImageType"))
107 img_ext = config->Read(
"lastImageType").c_str();
109 if (img_ext ==
"all images")
111 dlg.SetFilterIndex(0);
117 if (img_ext ==
"jpg")
118 dlg.SetFilterIndex(1);
119 else if (img_ext ==
"tiff")
120 dlg.SetFilterIndex(2);
121 else if (img_ext ==
"png")
122 dlg.SetFilterIndex(3);
123 else if (img_ext ==
"hdr")
124 dlg.SetFilterIndex(4);
125 else if (img_ext ==
"exr")
126 dlg.SetFilterIndex(5);
127 else if (img_ext ==
"all files")
128 dlg.SetFilterIndex(6);
132 if (img_ext ==
"all raws")
133 dlg.SetFilterIndex(1);
134 else if (img_ext ==
"jpg")
135 dlg.SetFilterIndex(2);
136 else if (img_ext ==
"tiff")
137 dlg.SetFilterIndex(3);
138 else if (img_ext ==
"png")
139 dlg.SetFilterIndex(4);
140 else if (img_ext ==
"hdr")
141 dlg.SetFilterIndex(5);
142 else if (img_ext ==
"exr")
143 dlg.SetFilterIndex(6);
148 if (dlg.ShowModal() == wxID_OK)
151 wxArrayString Pathnames;
152 dlg.GetPaths(Pathnames);
157 config->Write(
"/actualPath", wxPathOnly(Pathnames[0]));
159 config->Write(
"/actualPath", dlg.GetDirectory());
164 switch (dlg.GetFilterIndex())
166 case 0: config->Write(
"lastImageType",
"all images");
break;
167 case 1: config->Write(
"lastImageType",
"jpg");
break;
168 case 2: config->Write(
"lastImageType",
"tiff");
break;
169 case 3: config->Write(
"lastImageType",
"png");
break;
170 case 4: config->Write(
"lastImageType",
"hdr");
break;
171 case 5: config->Write(
"lastImageType",
"exr");
break;
172 case 6: config->Write(
"lastImageType",
"all files");
break;
177 switch (dlg.GetFilterIndex())
179 case 0: config->Write(
"lastImageType",
"all images");
break;
180 case 1: config->Write(
"lastImageType",
"all raws");
break;
181 case 2: config->Write(
"lastImageType",
"jpg");
break;
182 case 3: config->Write(
"lastImageType",
"tiff");
break;
183 case 4: config->Write(
"lastImageType",
"png");
break;
184 case 5: config->Write(
"lastImageType",
"hdr");
break;
185 case 6: config->Write(
"lastImageType",
"exr");
break;
187 withRaws = dlg.GetFilterIndex() == 1;
191 wxArrayString invalidFiles;
192 for(
unsigned int i=0;i<Pathnames.GetCount(); i++)
196 invalidFiles.Add(Pathnames[i]);
199 if(!invalidFiles.empty())
204 for (
unsigned int i=0; i<Pathnames.GetCount(); i++)
215 return _(
"Add individual images...");
220 std::vector<std::string> files;
221 bool withRaws =
true;
228 if (files.size() == 1)
231 _(
"Hugin"), wxICON_EXCLAMATION | wxYES_NO, parent);
232 message->SetYesNoLabels(_(
"Convert anyway"), _(
"Let me select several raw files"));
233 if (message->ShowModal() == wxID_NO)
236 wxCommandEvent newAddEvent(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"action_add_images"));
237 MainFrame::Get()->GetEventHandler()->AddPendingEvent(newAddEvent);
246 if (dlg.ShowModal() == wxID_OK)
266 #if defined EXIV2_VERSION && EXIV2_TEST_VERSION(0,27,99)
267 Exiv2::Image::UniquePtr image;
269 Exiv2::Image::AutoPtr image;
273 image = Exiv2::ImageFactory::open(filename);
279 if (image.get() == 0)
286 image->readMetadata();
288 catch (
const Exiv2::Error& e)
290 std::cerr <<
"Exiv2: Error reading metadata (" << e.what() <<
")" << std::endl;
293 Exiv2::ExifData &exifData = image->exifData();
294 if (exifData.empty())
299 Exiv2::Exifdatum& tag = exifData[
"Exif.Image.DateTime"];
300 const std::string date_time = tag.toString();
304 memset(&when, 0,
sizeof(when));
308 const int a = sscanf(date_time.c_str(),
"%d:%d:%d %d:%d:%d",
309 &when.tm_year, &when.tm_mon, &when.tm_mday,
310 &when.tm_hour, &when.tm_min, &when.tm_sec);
316 when.tm_year -= 1900;
325 stamp = mktime(&when);
326 if (stamp == (time_t)(-1))
335 bool operator()(
const std::string & s1,
const std::string & s2)
341 std::map<std::string, time_t> &
m_time;
346 return _(
"Add time-series of images...");
352 std::vector<std::string> files;
355 bool withRaws =
false;
370 files.push_back(pano.
getImage(i).getFilename());
377 StringToPointerHash filenames;
378 StringToFlagHash preloaded;
379 for(
size_t i=0;i<files.size();i++)
385 wxString path = ::wxPathOnly(file) +
"/*";
386 file = ::wxFindFirstFile(path);
387 while (!file.IsEmpty())
390 if(vigra::isImage(files[i].c_str()))
394 file = ::wxFindNextFile();
398 DEBUG_INFO(
"found " << filenames.size() <<
" candidate files to search.");
401 StringToPointerHash::iterator found;
402 std::map<std::string, time_t> timeMap;
403 for (found = filenames.begin(); found != filenames.end(); ++found)
405 wxString file = found->first;
410 filenames[file] = stamp;
418 for (found = filenames.begin(); found != filenames.end(); ++found)
420 wxString recruit = found->first;
421 if (preloaded[recruit] == 1)
423 time_t pledge = filenames[recruit];
428 for(
size_t i=0;i<files.size();i++)
435 time_t stamp = filenames[file];
436 if (abs((
int)(pledge - stamp)) < maxtimediff)
439 DEBUG_TRACE(
"Recruited " << recruit.mb_str(wxConvLocal));
441 files.push_back(file);
443 filenames[recruit] = 0;
453 sort(files.begin(), files.end(), spred);
466 return _(
"Manipulate image variables...");
472 if (dlg.ShowModal() == wxID_OK)
475 if (!expression.empty())
490 return _(
"Remove selected image(s)");
496 for (HuginBase::UIntSet::iterator it = images.begin(); it != images.end(); ++it)
505 return _(
"Anchor this image for position");
517 return _(
"Anchor this image for exposure");
542 return _(
"New lens");
566 return _(
"Change lens...");
572 long nr = wxGetNumberFromUser(
573 _(
"Enter new lens number"),
575 _(
"Change lens number"), 0, 0,
583 for (
const auto& img : images)
585 if (pano.
getImage(img).getSize() != lensImgSize)
587 hugin_utils::HuginMessageBox(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."),
589 _(
"Hugin"), wxICON_EXCLAMATION | wxOK, wxGetActiveWindow());
610 return _(
"Load lens from lens database");
614 return _(
"Load lens from ini file");
622 if (!
m_fromDatabase && images.size() == 1 && lensImages.size() > 1)
625 if (
hugin_utils::HuginMessageBox(_(
"You selected only one image.\nShould the loaded parameters be applied to all images with the same lens?"), _(
"Hugin"), wxICON_QUESTION | wxYES_NO, wxGetActiveWindow()) == wxYES)
628 std::copy(lensImages.begin(), lensImages.end(), std::inserter(images, images.end()));
631 vigra::Size2D sizeImg0=pano.
getImage(*(images.begin())).getSize();
633 bool differentImageSize=
false;
634 for(HuginBase::UIntSet::const_iterator it=images.begin();it!=images.end() && !differentImageSize;++it)
636 differentImageSize=(pano.
getImage(*it).getSize()!=sizeImg0);
638 if(differentImageSize)
640 if (
hugin_utils::HuginMessageBox(_(
"You selected images with different sizes.\nApply lens parameter file can result in unwanted results.\nApply settings anyway?"), _(
"Hugin"), wxICON_QUESTION | wxYES_NO, wxGetActiveWindow()) == wxNO)
674 return _(
"Save lens parameters to lens database");
678 return _(
"Save lens to ini file");
684 unsigned int imgNr = *(images.begin());
698 return _(
"Remove control points");
719 for (HuginBase::CPVector::const_iterator it = cps.begin(); it != cps.end(); ++it)
723 cpsToDelete.insert(it - cps.begin());
726 if(cpsToDelete.empty())
732 _(
"Hugin"), wxICON_QUESTION | wxYES_NO, wxGetActiveWindow()) == wxYES)
744 return _(
"Clean control points");
762 std::map<size_t,size_t> cpMap;
766 for(
size_t i=0;i<allCPs.size();i++)
771 firstCleanedCP.push_back(cp);
787 if(!removedCP2.empty())
789 for(HuginBase::UIntSet::const_iterator it=removedCP2.begin();it!=removedCP2.end();++it)
791 removedCPs.insert(cpMap[*it]);
800 if (!removedCPs.empty())
802 hugin_utils::HuginMessageBox(wxString::Format(_(
"Removed %lu control points"), (
unsigned long int)removedCPs.size()), _(
"Hugin"), wxOK | wxICON_INFORMATION, wxGetActiveWindow());
810 return _(
"Remove control points on clouds");
819 if (model == NULL || !progress.updateDisplay(_(
"Loading images")))
825 wxConfigBase *cfg = wxConfigBase::Get();
832 int radius=(t)?10:20;
836 for (HuginBase::UIntSet::const_iterator it=images.begin(); it!=images.end(); ++it)
842 if (!progress.updateDisplayValue())
849 vigra::UInt16RGBImage in;
850 if(img->image16->width()>0)
852 in.resize(img->image16->size());
858 in.resize(im8->size());
861 if (!img->iccProfile->empty())
865 if (!progress.updateDisplay(_(
"Running Celeste")))
871 if (!progress.updateDisplay())
877 for(HuginBase::UIntSet::const_iterator it2=cloudCP.begin();it2!=cloudCP.end(); ++it2)
879 cpsToRemove.insert(*it2);
882 if (!progress.updateDisplayValue(_(
"Loading images")))
888 if (!progress.updateDisplayValue())
892 if (!cpsToRemove.empty())
894 hugin_utils::HuginMessageBox(wxString::Format(_(
"Removed %lu control points"), (
unsigned long int) cpsToRemove.size()), _(
"Hugin"), wxOK | wxICON_INFORMATION, wxGetActiveWindow());
931 return _(
"Reset user defined...");
934 return _(
"Reset positions");
937 return _(
"Reset translation parameters");
940 return _(
"Reset lens parameters");
943 return _(
"Reset photometric parameters");
945 return wxEmptyString;
975 if(fabs(redBalanceAnchor)<1e-2)
979 if(fabs(blueBalanceAnchor)<1e-2)
985 for(HuginBase::UIntSet::const_iterator it = images.begin(); it != images.end(); ++it)
987 unsigned int imgNr = *it;
991 map_get(ImgVars,
"y").setValue(0);
992 map_get(ImgVars,
"p").setValue(0);
994 map_get(ImgVars,
"TrX").setValue(0);
995 map_get(ImgVars,
"TrY").setValue(0);
996 map_get(ImgVars,
"TrZ").setValue(0);
997 map_get(ImgVars,
"Tpy").setValue(0);
998 map_get(ImgVars,
"Tpp").setValue(0);
1002 map_get(ImgVars,
"TrX").setValue(0);
1003 map_get(ImgVars,
"TrY").setValue(0);
1004 map_get(ImgVars,
"TrZ").setValue(0);
1005 map_get(ImgVars,
"Tpy").setValue(0);
1006 map_get(ImgVars,
"Tpp").setValue(0);
1011 double focalLength=srcImg.getExifFocalLength();
1012 double cropFactor=srcImg.getExifCropFactor();
1013 if(focalLength!=0 && cropFactor!=0)
1018 map_get(ImgVars,
"v").setValue(newHFOV);
1024 map_get(ImgVars,
"a").setValue(0);
1025 map_get(ImgVars,
"b").setValue(0);
1026 map_get(ImgVars,
"c").setValue(0);
1027 map_get(ImgVars,
"d").setValue(0);
1028 map_get(ImgVars,
"e").setValue(0);
1029 map_get(ImgVars,
"g").setValue(0);
1030 map_get(ImgVars,
"t").setValue(0);
1040 map_get(ImgVars,
"Eev").setValue(eV);
1046 map_get(ImgVars,
"Eev").setValue(0);
1058 if(img.getExifMake() == anchor.getExifMake() &&
1059 img.getExifModel() == anchor.getExifModel())
1061 redBal=fabs(img.getExifRedBalance()/redBalanceAnchor);
1066 blueBal=fabs(img.getExifBlueBalance()/blueBalanceAnchor);
1072 map_get(ImgVars,
"Er").setValue(redBal);
1073 map_get(ImgVars,
"Eb").setValue(blueBal);
1077 map_get(ImgVars,
"Er").setValue(1);
1078 map_get(ImgVars,
"Eb").setValue(1);
1083 map_get(ImgVars,
"Vb").setValue(0);
1084 map_get(ImgVars,
"Vc").setValue(0);
1085 map_get(ImgVars,
"Vd").setValue(0);
1086 map_get(ImgVars,
"Vx").setValue(0);
1087 map_get(ImgVars,
"Vy").setValue(0);
1092 map_get(ImgVars,
"Ra").setValue(0);
1093 map_get(ImgVars,
"Rb").setValue(0);
1094 map_get(ImgVars,
"Rc").setValue(0);
1095 map_get(ImgVars,
"Rd").setValue(0);
1096 map_get(ImgVars,
"Re").setValue(0);
1098 vars.push_back(ImgVars);
1100 std::vector<PanoCommand::PanoCommand *> reset_commands;
1101 reset_commands.push_back(
1115 bool checkGeometric;
1116 bool checkPhotometric;
1121 checkGeometric=
true;
1122 checkPhotometric=
false;
1126 checkGeometric=
false;
1127 checkPhotometric=
true;
1131 checkGeometric=
true;
1132 checkPhotometric=
true;
1135 if(reset_dlg.ShowModal()==wxID_OK)
1144 if(checkPhotometric)
1202 return _(
"New stack");
1226 return _(
"Change stack...");
1232 long nr = wxGetNumberFromUser(
1233 _(
"Enter new stack number"),
1235 _(
"Change stack number"), 0, 0,
1243 for (
const auto& img : images)
1245 if (pano.
getImage(img).getSize() != stackImgSize)
1247 hugin_utils::HuginMessageBox(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."),
1249 _(
"Hugin"), wxICON_EXCLAMATION | wxOK, wxGetActiveWindow());
1269 return _(
"Set stack size...");
1274 wxConfigBase* cfg = wxConfigBase::Get();
1276 wxXmlResource::Get()->LoadDialog(&dlg, parent,
"stack_size_dialog");
1277 wxSpinCtrl* stackSpin = XRCCTRL(dlg,
"stack_size_spinctrl", wxSpinCtrl);
1279 size_t oldStackSize = cfg->Read(
"/StackDialog/StackSize", 3);
1281 stackSpin->SetValue(oldStackSize);
1282 wxCheckBox* linkCheckBox = XRCCTRL(dlg,
"stack_size_link_checkbox", wxCheckBox);
1283 linkCheckBox->SetValue(cfg->Read(
"/StackDialog/LinkPosition",
true) != 0
l);
1284 if (dlg.ShowModal() != wxID_OK)
1289 long stackSize = stackSpin->GetValue();
1290 bool linkPosition = linkCheckBox->IsChecked();
1291 cfg->Write(
"/StackDialog/StackSize", stackSize);
1292 cfg->Write(
"/StackDialog/LinkPosition", linkPosition);
1297 std::vector<PanoCommand::PanoCommand *> commands;
1317 for(
size_t i=0; i<stackSize && imgNr<pano.
getNrOfImages(); i++)
1327 if (!linkPosition && stackSize > 1)
1332 std::set<HuginBase::ImageVariableGroup::ImageVariableEnum> variables;
1333 variables.insert(HuginBase::ImageVariableGroup::IVE_Yaw);
1334 variables.insert(HuginBase::ImageVariableGroup::IVE_Pitch);
1335 variables.insert(HuginBase::ImageVariableGroup::IVE_Roll);
1336 variables.insert(HuginBase::ImageVariableGroup::IVE_X);
1337 variables.insert(HuginBase::ImageVariableGroup::IVE_Y);
1338 variables.insert(HuginBase::ImageVariableGroup::IVE_Z);
1339 variables.insert(HuginBase::ImageVariableGroup::IVE_TranslationPlaneYaw);
1340 variables.insert(HuginBase::ImageVariableGroup::IVE_TranslationPlanePitch);
1412 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.
std::unique_ptr< wxMessageDialogBase > MessageDialog
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
MessageDialog GetMessageDialog(const wxString &message, const wxString &caption, int style, wxWindow *parent)
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
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
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...