Hugin trunk 0.1
Loading...
Searching...
No Matches
Classes | Functions | Variables
stacker.cpp File Reference

program to merge images in a stack More...

#include <stdio.h>
#include <iostream>
#include <fstream>
#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

◆ CheckInput()

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

Definition at line 582 of file stacker.cpp.

References threshold().

Referenced by StackImages(), and StackImagesAndMask().

◆ CleanUp()

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

Definition at line 865 of file stacker.cpp.

Referenced by main().

◆ getMean()

template<class ValueType >
void getMean ( const std::vector< ValueType > &  values,
ValueType &  val 
)

◆ getMeanSigma()

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

◆ main()

int main ( int  argc,
char argv[] 
)

◆ main_stacker()

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

Definition at line 874 of file stacker.cpp.

References threshold().

◆ SaveFinalImage()

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 108 of file stacker.cpp.

References SaveImage(), and threshold().

Referenced by StackImages(), and StackImagesAndMask().

◆ SaveImage()

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 60 of file stacker.cpp.

References vigra::exportImageAlpha(), and threshold().

Referenced by SaveFinalImage().

◆ SetCompression()

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

set compression for jpeg or tiff

Definition at line 42 of file stacker.cpp.

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

Referenced by StackImages(), and StackImagesAndMask().

◆ StackImages()

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 613 of file stacker.cpp.

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

◆ StackImagesAndMask()

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

◆ usage()

static void usage ( const char name)
static

prints help screen

Definition at line 134 of file stacker.cpp.

References hugin_utils::GetHuginVersion().

Variable Documentation

◆ Parameters