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
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
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
static void usage (const char *name)
 prints help screen
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
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.

References cerr.

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 
)

Definition at line 357 of file stacker.cpp.

Referenced by SigmaMeanStacker< ValueType >::getResult(), and WinsorMeanStacker< ValueType >::getResult().

template<class ValueType>
void getMeanSigma ( const std::vector< ValueType > &  values,
ValueType &  val,
typename vigra::NumericTraits< ValueType >::RealPromote &  sigma 
)

Definition at line 371 of file stacker.cpp.

Referenced by SigmaMeanStacker< ValueType >::getResult(), SigmaMeanStacker< ValueType >::getResultAndSigma(), WinsorMeanStacker< ValueType >::getResultAndSigma(), and MedianStacker< ValueType >::getResultAndSigma().

int main ( int  argc,
char *  argv[] 
)

Definition at line 991 of file stacker.cpp.

References cerr, CleanUp(), hugin_utils::EnforceExtension(), hugin_utils::FileExists(), hugin_utils::getExtension(), hugin_utils::IsFileTypeSupported(), hugin_utils::stringToDouble(), hugin_utils::stringToInt(), hugin_utils::stripPath(), hugin_utils::tolower(), hugin_utils::toupper(), and usage().

template<class PixelType>
bool main_stacker ( std::vector< InputImage * > &  images  ) 

Definition at line 909 of file stacker.cpp.

References cerr, and cout.

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 cerr, celeste::max(), and SaveImage().

Referenced by LoadAndMergeImages(), ResaveImage(), 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 cerr, cout, 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(), cout, SaveFinalImage(), and SetCompression().

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

Definition at line 745 of file stacker.cpp.

References cerr, CheckInput(), vigra::omp::combineThreeImages(), cout, vigra_ext::createAlphaTiffImage(), vigra_ext::createTiffDirectory(), vigra_ext::destImage(), vigra::exportImageAlpha(), hugin_utils::FileExists(), vigra::importImageAlpha(), SaveFinalImage(), SetCompression(), sigma, vigra_ext::srcImage(), and vigra_ext::srcImageRange().

static void usage ( const char *  name  )  [static]

prints help screen

Definition at line 133 of file stacker.cpp.

References cout, and hugin_utils::GetHuginVersion().


Variable Documentation

struct GeneralParameters Parameters [static]


Generated on 23 Jan 2018 for Hugintrunk by  doxygen 1.4.7