Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions | Variables
stacker.cpp File Reference

program to merge images in a stack More...

#include <stdio.h>
#include <iostream>
#include <getopt.h>
#include <hugin_utils/utils.h>
#include <hugin_utils/stl_utils.h>
#include <vigra/imageinfo.hxx>
#include <vigra/codec.hxx>
#include <vigra/stdimage.hxx>
#include <vigra_ext/impexalpha.hxx>
#include <vigra/tiff.hxx>
#include <vigra_ext/tiffUtils.h>
#include <vigra_ext/openmp_vigra.h>
Include dependency graph for stacker.cpp:

Go to the source code of this file.

Classes

struct  GeneralParameters
 
class  InputImage
 
class  MinStacker< ValueType >
 
class  MaxStacker< ValueType >
 
class  AverageStacker< ValueType >
 
class  MedianStacker< ValueType >
 
class  WinsorMeanStacker< ValueType >
 
class  SigmaMeanStacker< ValueType >
 
class  FilterMask< PixelType >
 

Functions

void SetCompression (vigra::ImageExportInfo &output, const std::string &compression)
 set compression for jpeg or tiff More...
 
template<class ImageType , class MaskType >
bool SaveImage (ImageType &image, MaskType &mask, vigra::ImageExportInfo &exportImageInfo, std::string filetype, std::string pixelType)
 save image, when possible with alpha channel, take care of formats which does not support alpha channels More...
 
template<class ImageType , class MaskType >
bool SaveFinalImage (ImageType &image, MaskType &mask, const std::string &inputPixelType, vigra::ImageExportInfo &output)
 save final image, take care of some supported pixel types and convert when necessary to smaller pixel type More...
 
static void usage (const char *name)
 prints help screen More...
 
template<class ValueType >
void getMean (const std::vector< ValueType > &values, ValueType &val)
 
template<class ValueType >
void getMeanSigma (const std::vector< ValueType > &values, ValueType &val, typename vigra::NumericTraits< ValueType >::RealPromote &sigma)
 
bool CheckInput (const std::vector< InputImage * > &images, vigra::Rect2D &outputROI, vigra::Size2D &canvasSize)
 
template<class PixelType , class Functor >
bool StackImages (std::vector< InputImage * > &images, Functor &stacker)
 loads images line by line and merge into final image, save the result More...
 
template<class PixelType , class Functor >
bool StackImagesAndMask (std::vector< InputImage * > &images, Functor &stacker)
 
void CleanUp (std::vector< InputImage * > &images)
 
template<class PixelType >
bool main_stacker (std::vector< InputImage * > &images)
 
int main (int argc, char *argv[])
 

Variables

static struct GeneralParameters Parameters
 

Detailed Description

program to merge images in a stack

Author
T. Modes

Definition in file stacker.cpp.

Function Documentation

bool CheckInput ( const std::vector< InputImage * > &  images,
vigra::Rect2D &  outputROI,
vigra::Size2D &  canvasSize 
)

Definition at line 614 of file stacker.cpp.

Referenced by StackImages(), and StackImagesAndMask().

void CleanUp ( std::vector< InputImage * > &  images)

Definition at line 900 of file stacker.cpp.

Referenced by main().

template<class ValueType >
void getMean ( const std::vector< ValueType > &  values,
ValueType &  val 
)
template<class ValueType >
void getMeanSigma ( const std::vector< ValueType > &  values,
ValueType &  val,
typename vigra::NumericTraits< ValueType >::RealPromote &  sigma 
)
int main ( int  argc,
char *  argv[] 
)
template<class PixelType >
bool main_stacker ( std::vector< InputImage * > &  images)

Definition at line 909 of file stacker.cpp.

template<class ImageType , class MaskType >
bool SaveFinalImage ( ImageType image,
MaskType &  mask,
const std::string &  inputPixelType,
vigra::ImageExportInfo &  output 
)

save final image, take care of some supported pixel types and convert when necessary to smaller pixel type

Definition at line 107 of file stacker.cpp.

References celeste::max(), and SaveImage().

Referenced by LoadAndMergeImages(), ResaveImageFill(), StackImages(), and StackImagesAndMask().

template<class ImageType , class MaskType >
bool SaveImage ( ImageType image,
MaskType &  mask,
vigra::ImageExportInfo &  exportImageInfo,
std::string  filetype,
std::string  pixelType 
)

save image, when possible with alpha channel, take care of formats which does not support alpha channels

Definition at line 59 of file stacker.cpp.

References vigra::exportImageAlpha(), vigra_ext::srcImage(), and vigra_ext::srcImageRange().

Referenced by SaveFinalImage().

void SetCompression ( vigra::ImageExportInfo &  output,
const std::string &  compression 
)

set compression for jpeg or tiff

Definition at line 41 of file stacker.cpp.

References hugin_utils::getExtension(), and hugin_utils::toupper().

Referenced by LoadAndMergeImages(), main(), StackImages(), and StackImagesAndMask().

template<class PixelType , class Functor >
bool StackImages ( std::vector< InputImage * > &  images,
Functor &  stacker 
)

loads images line by line and merge into final image, save the result

Definition at line 645 of file stacker.cpp.

References CheckInput(), SaveFinalImage(), and SetCompression().

template<class PixelType , class Functor >
bool StackImagesAndMask ( std::vector< InputImage * > &  images,
Functor &  stacker 
)
static void usage ( const char *  name)
static

prints help screen

Definition at line 133 of file stacker.cpp.

References hugin_utils::GetHuginVersion().

Variable Documentation