32 #include <vigra/error.hxx>
33 #include <vigra/impex.hxx>
39 template<
class ImageType>
42 std::vector<ImageType *> srcImgs(files.size());
43 limits.resize(srcImgs.size());
48 std::string s = vigra::impexListExtensions();
50 #pragma omp parallel for schedule(dynamic)
51 for (
int i=0; i < files.size(); i++) {
54 std::ostringstream buf;
55 vigra::ImageImportInfo
info(files[i].c_str());
56 tImg->resize(info.size());
58 buf <<
"loading: " << files[i] << std::endl;
60 const std::string pixelType(info.getPixelType());
61 if (info.numExtraBands() == 1) {
63 vigra::BImage mask(info.size());
65 if (pixelType ==
"FLOAT" || pixelType ==
"DOUBLE")
69 imageStepSize =
std::min(imageStepSize, (minmax.
max - minmax.
min) / 16384.0f);
73 if (pixelType ==
"FLOAT" || pixelType ==
"DOUBLE")
77 imageStepSize =
std::min(imageStepSize, (minmax.
max - minmax.
min) / 16384.0f);
82 if (pixelType==
"UINT8") {
85 imageStepSize =
std::min(imageStepSize, 1 / 255.0f);
87 }
else if (pixelType==
"UINT16") {
90 imageStepSize =
std::min(imageStepSize, 1 / 65536.0f);
97 buf <<
"downscaling: ";
99 for (
int l=pyrLevel; l > 0; l--) {
101 buf << tImg->size().x <<
"x" << tImg->size().y <<
" " << std::flush;
114 vigra::functor::Arg1()*vigra::functor::Param(div));
120 std::cout << buf.str();
131 std::vector<std::string> files;
133 files.push_back(pano.
getImage(i).getFilename());
135 std::vector<vigra::FRGBImage*> images;
137 imageStepSize = 1 / 255.0f;
140 images = loadImagesPyr<vigra::FRGBImage>(files, pyrLevel, verbose, limits, imageStepSize);
void reduceToNextLevel(ImageIn &in, ImageOut &out)
static void swap(T &x, T &y)
class for storing the limits of an image used by the sampler to exclude too dark or too bright pixel ...
void transformImage(vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, vigra::triple< DestImageIterator, DestImageIterator, DestAccessor > dest, std::pair< AlphaImageIterator, AlphaAccessor > alpha, vigra::Diff2D destUL, TRANSFORM &transform, PixelTransform &pixelTransform, bool warparound, Interpolator interpol, AppBase::ProgressDisplay *progress, bool singleThreaded=false)
Transform an image into the panorama.
vigra::pair< typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::ImageConstAccessor > srcImage(const ROIImage< Image, Mask > &img)
PointPairs getResultPoints()
void taskFinished()
call when a task has finished and the status message should be cleared
std::size_t getNrOfImages() const
number of images.
vigra::FRGBImage ImageType
void setMessage(const std::string &message, const std::string &filename="")
sets the message to given string
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
VALUETYPE min
the current min
void importImageAlpha(const ImageImportInfo &import_info, ImageIterator image_iterator, ImageAccessor image_accessor, AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor)
Read the image specified by the given vigra::ImageImportInfo object including its alpha channel...
VALUETYPE max
the current max
std::vector< LimitIntensity > LimitIntensityVector
static void info(const char *fmt,...)
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0