33 bool GenerateThumbnail(
const std::string pto_filename,
const wxSize size, vigra::BRGBImage& panoImage, vigra::BImage& panoMask, vigra::ImageImportInfo::ICCProfile& iccProfile)
56 const vigra::Rect2D roi(opts.getROI());
57 const double scale =
std::max(roi.width() * 1.0 / size.GetWidth(), roi.height() * 1.0 / size.GetHeight());
58 opts.setWidth(opts.getWidth() / scale);
60 vigra::Rect2D newROI(opts.getROI());
61 newROI.addSize(vigra::Size2D(
std::min(size.GetWidth() - newROI.width(), 0),
std::min(size.GetHeight() - newROI.height(), 0)));
66 opts.tiff_saveROI =
false;
68 opts.outputImageType =
"png";
70 opts.remapUsingGPU =
false;
74 opts.outputEMoRParams = pano.
getSrcImage(0).getEMoRParams();
79 opts.outputEMoRParams.clear();
88 vigra::BRGBImage preview(opts.getWidth(), opts.getHeight());
89 vigra::BImage previewMask(opts.getWidth(), opts.getHeight());
92 stitcher.
stitch(opts, pano.
getActiveImages(), std::string(), preview, previewMask, remapper, advOptions);
95 panoImage.resize(stitcher.
GetPanoROI().size());
96 panoMask.resize(panoImage.size());
generate thumbnail from given pto file
bool FileExists(const std::string &filename)
checks if file exists
Dummy progress display, without output.
vigra::ImageImportInfo::ICCProfile GetICCProfile() const
void stitch(const PanoramaOptions &opts, const UIntSet &imgSet, const std::string &filename, ImageType &panoImage, AlphaType &alpha, SingleImageRemapper< ImageType, AlphaType > &remapper, const AdvancedOptions &advOptions)
SrcPanoImage getSrcImage(unsigned imgNr) const
get a description of a source image
vigra::Rect2D GetPanoROI() const
void init(const PanoramaOptions &opts, const UIntSet &images)
empirical model of response
std::string getPathPrefix(const std::string &filename)
Get the path to a filename.
std::size_t getNrOfImages() const
number of images.
bool ReadPTOFile(const std::string &filename, const std::string &prefix="")
read pto file from the given filename into Panorama object it does some checks on the file and issues...
vigra::pair< typename ROIImage< Image, Alpha >::image_traverser, typename ROIImage< Image, Alpha >::ImageAccessor > destImage(ROIImage< Image, Alpha > &img)
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
UIntSet getActiveImages() const
get active images
Contains various routines used for stitching panoramas.
const PanoramaOptions & getOptions() const
returns the options for this panorama
void setAdvancedOptions(const HuginBase::Nona::AdvancedOptions advancedOptions)
bool GenerateThumbnail(const std::string pto_filename, const wxSize size, vigra::BRGBImage &panoImage, vigra::BImage &panoMask, vigra::ImageImportInfo::ICCProfile &iccProfile)
generate thumbnail image for given pto_filename
std::map< std::string, std::string > AdvancedOptions
void copyImage(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc)
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
functor to create a remapped image, loads image from disk
void SetAdvancedOption(AdvancedOptions &opts, const std::string &name, const bool value)
store the option with name in AdvancedOptions