28#include <vigra/stdimage.hxx>
43 const std::string & basename,
50 unsigned int imgNr = *(
usedImgs.begin());
51 std::string
fname = pano.
getImage(imgNr).getFilename().c_str();
53 vigra::ImageImportInfo info(
fname.c_str());
54 std::string
pixelType = info.getPixelType();
55 int bands = info.numBands();
60 vigra::ImageImportInfo
info2(pano.
getImage(*it).getFilename().c_str());
63 pano.
getImage(*it).getFilename() <<
" uses " <<
64 info2.getPixelType() <<
" valued pixel, while " <<
71 pano.
getImage(*it).getFilename() <<
" has " <<
72 info2.numBands() <<
" channels, while " <<
73 pano.
getImage(0).getFilename() <<
" uses: " << bands);
105 if (bands == 1 || (bands == 2 &&
extraBands == 1)) {
107 }
else if (bands == 3 || (bands == 4 &&
extraBands == 1)) {
110 DEBUG_ERROR(
"unsupported depth, only images with 1 and 3 channel images are supported");
111 throw std::runtime_error(
"unsupported depth, only images with 1 and 3 channel images are supported");
115 if (bands == 1 || (bands == 2 &&
extraBands == 1)) {
124 }
else if (bands == 3 || (bands == 4 &&
extraBands == 1)) {
137 if (bands == 1 || (bands == 2 &&
extraBands == 1)) {
139 }
else if (bands == 3 || (bands == 4 &&
extraBands == 1)) {
142 DEBUG_ERROR(
"unsupported depth, only images with 1 and 3 channel images are supported");
143 throw std::runtime_error(
"unsupported depth, only images with 1 and 3 channel images are supported");
Contains various routines used for stitching panoramas.
@ RESPONSE_EMOR
empirical model of response
virtual SrcPanoImage getSrcImage(unsigned imgNr) const =0
get a complete description of a source image
virtual const SrcPanoImage & getImage(std::size_t nr) const =0
get a panorama image, counting starts with 0
virtual std::size_t getNrOfImages() const =0
number of images.
std::vector< float > outputEMoRParams
std::string outputPixelType
#define DEBUG_ASSERT(cond)
#define UTILS_THROW(class, msg)
void stitchPanoRGB_32_float(const PanoramaData &pano, const PanoramaOptions &opts, AppBase::ProgressDisplay *progress, const std::string &basename, const UIntSet &usedImgs, const char *pixelType, const AdvancedOptions &advOptions)
void stitchPanoGray_32_float(const PanoramaData &pano, const PanoramaOptions &opts, AppBase::ProgressDisplay *progress, const std::string &basename, const UIntSet &usedImgs, const char *pixelType, const AdvancedOptions &advOptions)
std::map< std::string, std::string > AdvancedOptions
void stitchPanorama(const PanoramaData &pano, const PanoramaOptions &opt, AppBase::ProgressDisplay *progress, const std::string &basename, const UIntSet &usedImgs, const AdvancedOptions &advOptions)
The main stitching function.
void stitchPanoRGB_8_16(const PanoramaData &pano, const PanoramaOptions &opts, AppBase::ProgressDisplay *progress, const std::string &basename, const UIntSet &usedImgs, const char *pixelType, const AdvancedOptions &advOptions)
void stitchPanoGray_8_16(const PanoramaData &pano, const PanoramaOptions &opts, AppBase::ProgressDisplay *progress, const std::string &basename, const UIntSet &usedImgs, const char *pixelType, const AdvancedOptions &advOptions)
mainly consists of wrapper around the pano tools library, to assist in ressource management and to pr...
std::set< unsigned int > UIntSet
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.