34#include "wx/mstream.h"
39#include <exiv2/exiv2.hpp>
70 wxXmlResource::Get()->LoadDialog(
this,
batchframe,
"find_pano_dialog");
111 config->Read(
"/FindPanoDialog/includeSubDirs",&val,
false);
113 long i=
config->Read(
"/FindPanoDialog/Naming",0l);
115 config->Read(
"/FindPanoDialog/linkStacks",&val,
true);
117 config->Read(
"/FindPanoDialog/loadDistortion",&val,
false);
119 config->Read(
"/FindPanoDialog/loadVignetting",&val,
false);
121 i=
config->Read(
"/FindPanoDialog/MinNumberImages", 2l);
123 i=
config->Read(
"/FindPanoDialog/MaxTimeDiff", 30l);
188 if (
hugin_utils::HuginMessageBox(
_(
"The list contains possibly unprocessed panoramas.\nIf you close the dialog, you will lose them.\nContinue anyway?"),
213 if (
hugin_utils::HuginMessageBox(
_(
"The list contains still not yet processed panoramas.\nIf you continue, they will be disregarded.\nDo you still want to continue?"),
226 wxCommandEvent
dummy;
267 if(!filename.IsEmpty())
279 hugin_utils::HuginMessageBox(
_(
"Not all project files could be written successfully.\nMaybe you have no write permission for these directories or your disc is full."),
_(
"PTBatcherGUI"),
wxOK,
this);
326 long imageIndex = -1;
328 if(imageIndex > 1 && imageIndex <=
static_cast<long>(
m_panos[
selectedPano]->GetImageCount()) - 2)
346 long imageIndex = -1;
357 wxCommandEvent
dummy;
369 long imageIndex = -1;
373 if (imageIndex > 1 && imageIndex <=
static_cast<long>(
m_panos[
selectedPano]->GetImageCount()) - 2)
386 wxCommandEvent
dummy;
425 std::vector<PossiblePano*>
newPanos;
438 if(
ext.CmpNoCase(
"jpg")==0 ||
ext.CmpNoCase(
"jpeg")==0 ||
439 ext.CmpNoCase(
"tif")==0 ||
ext.CmpNoCase(
"tiff")==0)
447 HuginBase::FileMetaData::const_iterator
it =
metadata.find(
"pixeltype");
450 if (
it->second ==
"BILEVEL")
457 if(!img->getExifMake().empty() && !img->getExifModel().empty() &&
458 img->getExifFocalLength()!=0 && img->getCropFactor()!=0)
537 m_statustext->SetLabel(wxString::Format(
_(
"Found %d possible panoramas"),
static_cast<int>(
m_panos.size())));
560 if(
m_make.compare(img->getExifMake())!=0)
564 if(
m_camera.compare(img->getExifModel())!=0)
568 if(
m_lens.compare(img->getExifLens())!=0)
580 if(
m_size!=img->getSize())
601 return file.GetModificationTime();
610 m_make=img->getExifMake();
612 m_lens=img->getExifLens();
639 ImageSet::const_reverse_iterator
rit=
m_images.rbegin();
647 return f1.GetFullPath()+
" - "+f2.GetFullName();
874 list->DeleteAllItems();
880#if defined EXIV2_VERSION && EXIV2_TEST_VERSION(0,27,99)
881 Exiv2::Image::UniquePtr image;
883 Exiv2::Image::AutoPtr image;
888 image = Exiv2::ImageFactory::open((*it)->getFilename().c_str());
893 std::cerr <<
__FILE__ <<
" " <<
__LINE__ <<
" Error opening file" << std::endl;
901 image->readMetadata();
903 catch (
const Exiv2::Error& e)
905 std::cerr <<
__FILE__ <<
" " <<
__LINE__ <<
" Exiv2: Error reading metadata (" << e.what() <<
")" << std::endl;
909 Exiv2::PreviewManager
previews(*image);
910 Exiv2::PreviewPropertiesList
lists =
previews.getPreviewProperties();
943 if ((*it)->getRoll() == 90)
950 if ((*it)->getRoll() == 270)
957 if ((*it)->getRoll() == 180)
966 dc.SetBackground(list->GetBackgroundColour());
980 list->InsertItem(list->GetItemCount(),
fn.GetFullName(), index);
994 std::advance(
item, index);
1010 ImageSet::iterator img =
allImages.begin();
int SortWxFilenames(const wxString &s1, const wxString &s2)
Definition of dialog to change user defined sequence.
std::set< HuginBase::SrcPanoImage *, SortFilename > ImageSet
some definitions to work with optimizer master switches
Batch processor for Hugin with GUI.
Somewhere to specify what variables belong to what.
void AddToList(wxString aFile, Project::Target target=Project::STITCHING, wxString userDefined=wxEmptyString)
void OnSelectPossiblePano(wxCommandEvent &e)
event to populate information on the right
wxSpinCtrl * m_sc_minNumberImages
void SearchInDir(wxString dirstring, const bool includeSubdir, const bool loadDistortion, const bool loadVignetting, const size_t minNumberImages, const size_t maxTimeDiff)
wxStaticText * m_statustext
BatchFrame * m_batchframe
wxDirPickerCtrl * m_dirPicker
FindPanoDialog(BatchFrame *batchframe, wxString xrcPrefix)
Constructor, read from xrc ressource; restore last uses settings, size and position.
TIFFErrorHandler m_oldtiffwarning
void OnClose(wxCloseEvent &e)
prevents closing window when running detection
wxSpinCtrl * m_sc_maxTimeDiff
void OnButtonStart(wxCommandEvent &e)
start/stops detections
wxCheckListBox * m_list_pano
wxCheckBox * m_cb_createLinks
wxButton * m_button_start
void OnSplitPanos(wxCommandEvent &e)
event handler to split into 2 panos
void OnListMouseMove(wxMouseEvent &e)
mouse move handler for tooltips
std::vector< PossiblePano * > m_panos
void OnRemoveImage(wxCommandEvent &e)
event handler to remove selected image from list
void EnableButtons(const bool state)
wxListCtrl * m_thumbsList
wxCheckBox * m_cb_loadVignetting
wxButton * m_button_close
void OnButtonClose(wxCommandEvent &e)
closes window
void OnButtonSend(wxCommandEvent &e)
add selected projects to queue
wxCheckBox * m_cb_loadDistortion
void OnListItemRightClick(wxListEvent &e)
event handler for context menu
~FindPanoDialog()
destructor, saves size and position
Same as above, but use a non const panorama.
void switchParts(unsigned int ImageNr, unsigned int partNr)
switch a given image to a different part number.
BlendingMechanism blendMode
vigra_ext::Interpolator interpolator
std::string hdrmergeOptions
std::string verdandiOptions
double outputExposureValue
std::string enblendOptions
BlendingMechanism
blenders
std::string tiffCompression
std::string outputImageType
HDRMergeType hdrMergeMode
std::string enfuseOptions
std::string outputImageTypeCompression
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
const bool hasPossibleStacks() const
return true, if the metadata indicates that the projects is a bracketet project
unsigned int addImage(const SrcPanoImage &img)
the the number for a specific image
void setOptions(const PanoramaOptions &opt)
set new output settings This is not used directly for optimizing/stiching, but it can be feed into ru...
bool WritePTOFile(const std::string &filename, const std::string &prefix="")
write data to given pto file
void setPhotometricOptimizerSwitch(const int newSwitch)
sets the photometric optimizer master switch
void linkPossibleStacks(bool linkPosition)
create automatically stacks as indicated by metadata
void setOptimizerSwitch(const int newSwitch)
set optimizer master switch
std::size_t getNrOfImages() const
number of images.
All variables of a source image.
bool applyEXIFValues(bool applyEVValue=true)
apply values found in EXIF data to SrcPanoImage class, call readEXIF() before to initialize some valu...
bool readDistortionFromDB()
tries to read distortion data from lens database you need to call SrcPanoImage::readEXIF before to fi...
bool readVignettingFromDB()
tries to read vignetting data from lens database you need to call SrcPanoImage::readEXIF before to fi...
const int getExifDateTime(struct tm *datetime) const
try to convert Exif date time string to struct tm
bool readProjectionFromDB(const bool ignoreFovRectilinear=true)
tries to read projection and crop area from lens database you need to call SrcPanoImage::readEXIF bef...
bool readEXIF()
try to fill out information about the image, by examining the exif data
void UpdateDateTimes()
updates the internal date/time representations
wxString GeneratePanorama(NamingConvention nc, bool createLinks, HuginBase::PanoramaOptions::BlendingMechanism defaultBlender)
generates the panorama file from this set of images
PossiblePano * SplitPano(const unsigned int index)
split pano into 2 subpanos, index is used as first image of second pano
wxString GetStartString()
return the start date/time as string
NamingConvention
enumeration for different naming conventions, must be match combobox in ressource
wxString GetFocalLength()
returns the focal length as string
bool GetNewProjectFilename(NamingConvention nc, const wxString basePath, wxFileName &projectFile)
returns a given filename, which does not already exists
const wxString GetFilestring(const wxString BasePath, const bool stripExtension=false) const
returns a string with the filename of the first and last file
wxString GetCameraName()
returns the camera name
void PopulateListCtrl(wxListCtrl *list, wxImageList *thumbs, wxArrayString &tooltips)
add all images to wxListCtrl
void RemoveImage(const unsigned int index)
removes the image at given index
~PossiblePano()
destructor, cleans up used variables
wxString GetDuration()
returns the duration as string
wxString GetLensName()
returns the lens name
void AddSrcPanoImage(HuginBase::SrcPanoImage *img)
adds the given SrcPanoImage to this pano-group
PossiblePano()
constructor, init values
bool BelongsTo(HuginBase::SrcPanoImage *img, const wxTimeSpan max_time_diff)
return true, if the image could belong to the given PossiblePano, it checks camera maker and model,...
const wxDateTime GetDateTime(const HuginBase::SrcPanoImage *img)
does some reformating date/time format
const wxString GetItemString(const wxString BasePath) const
returns a string which contains description of this pano
#define HUGIN_JPEG_QUALITY
#define HUGIN_ENBLEND_ARGS
#define HUGIN_NONA_CROPPEDIMAGES
#define HUGIN_TIFF_COMPRESSION
#define HUGIN_ENFUSE_ARGS
#define HUGIN_NONA_INTERPOLATOR
#define HUGIN_HDRMERGE_ARGS
#define HUGIN_LDR_OUTPUT_FORMAT
wxString getDefaultProjectName(const HuginBase::Panorama &pano, const wxString filenameTemplate)
gets the default project name, as defined in the preferences
std::map< std::string, std::string > FileMetaData
typedef for general map for storing metadata in files
int alphanum_comp(const std::string &l, const std::string &r)
Compare l and r with the same semantics as strcmp(), but with the "Alphanum Algorithm" which produces...
WXIMPEX wxString GetFormattedTimeSpan(const wxTimeSpan &timeSpan)
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
Interpolator
enum with all interpolation methods
include file for the hugin project
bool operator()(const HuginBase::SrcPanoImage *img1, const HuginBase::SrcPanoImage *img2) const
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.