utils.h File Reference

functions to manage ROI's More...

#include <hugin_math/hugin_math.h>
#include <vigra/rgbvalue.hxx>
#include <vigra/transformimage.hxx>
#include <cmath>

Include dependency graph for utils.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  vigra
namespace  vigra_ext

Classes

struct  vigra::PromoteTraits< RGBValue< T1, R, G, B >, T2 >
struct  vigra_ext::PointPairT< VALUE >
struct  vigra_ext::ValueTypeTraits< T1 >
struct  vigra_ext::OverlapSizeCounter
 count pixels that are > 0 in both images More...
struct  vigra_ext::NestFunctor< F1, F2 >
 functor to combine two functors: result = f1( f2(v) ) More...
struct  vigra_ext::MaskPixelCounter
 count pixels that are > 0 in a single image More...
struct  vigra_ext::PassThroughFunctor< T >
 does nothing More...
struct  vigra_ext::LinearTransform< DestValueType >
struct  vigra_ext::ApplyLogFunctor
struct  vigra_ext::ApplyGammaFunctor< TIn, TOut >
struct  vigra_ext::ApplyGammaFunctor< vigra::UInt16, vigra::UInt8 >

Defines

#define LUT_TRAITS(T1, S)
 Traits to define the maximum value for all types.
#define VT_TRAITS_VEC(T1)
#define VT_TRAITS(T1)

Typedefs

typedef PointPairT< float > PointPair
typedef PointPairT< vigra::RGBValue<
float > > 
PointPairRGB

Functions

 LUT_TRAITS (unsigned char, UCHAR_MAX)
 LUT_TRAITS (signed char, SCHAR_MAX)
 LUT_TRAITS (unsigned short, USHRT_MAX)
 LUT_TRAITS (signed short, SHRT_MAX)
 LUT_TRAITS (unsigned int, UINT_MAX)
 LUT_TRAITS (signed int, INT_MAX)
 LUT_TRAITS (float, 1.0)
 LUT_TRAITS (double, 1.0)
double getMaxValForPixelType (const std::string &v)
 VT_TRAITS (vigra::UInt8)
 VT_TRAITS (vigra::Int16)
 VT_TRAITS (vigra::UInt16)
 VT_TRAITS (vigra::Int32)
 VT_TRAITS (vigra::UInt32)
 VT_TRAITS (float)
 VT_TRAITS (double)
float pow (float a, double b)
template<class T, unsigned int R, unsigned int G, unsigned int B>
vigra::RGBValue< T, R, G, B > pow (vigra::RGBValue< T, R, G, B > const &v, double e)
 component-wise absolute value
template<class V1, unsigned int R, unsigned int G, unsigned int B, class V2>
vigra::RGBValue< V1, R, G,
B > & 
operator+= (vigra::RGBValue< V1, R, G, B > &l, V2 const &r)
 add a scalar to all components
template<class T, unsigned int RIDX, unsigned int GIDX, unsigned int BIDX>
vigra::RGBValue< T, RIDX,
GIDX, BIDX > 
log (vigra::RGBValue< T, RIDX, GIDX, BIDX > const &v)
 component-wise logarithm
template<class T, unsigned int RIDX, unsigned int GIDX, unsigned int BIDX>
vigra::RGBValue< T, RIDX,
GIDX, BIDX > 
log10 (vigra::RGBValue< T, RIDX, GIDX, BIDX > const &v)
 component-wise logarithm
template<class V1, unsigned int R, unsigned int G, unsigned int B, class V2>
vigra::PromoteTraits< vigra::RGBValue<
V1, R, G, B >, V2 >::Promote 
operator+ (vigra::RGBValue< V1, R, G, B > const &r1, V2 const &r2)
 add a scalar to all components
template<class V, int SIZE, class D1, class D2>
vigra::TinyVector< V, SIZE > pow (vigra::TinyVector< V, SIZE > const &v, double e)
 Apply pow() function to each vector component.
template<class V, int SIZE, class D1, class D2>
vigra::TinyVector< V, SIZE > log (vigra::TinyVector< V, SIZE > const &v, double e)
 Apply log() function to each vector component.
template<class V>
getMaxComponent (vigra::RGBValue< V > const &v)
 get the maximum component of a vector (also works for single pixel types...)
template<class V>
getMaxComponent (V v)
 get the maximum component of a vector (also works for single pixel types...)
template<class V>
getMinComponent (vigra::RGBValue< V > const &v)
 get the maximum component of a vector (also works for single pixel types...)
template<class V>
getMinComponent (V v)
 get the maximum component of a vector (also works for single pixel types...)
template<class SrcImageIterator, class SrcAccessor>
void circularCrop (vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > img, hugin_utils::FDiff2D middle, double radius)
 Apply a circular crop to img.
template<class T>
vigra::NumericTraits< T
>::RealPromote 
normalizeValue (T v, vigra::VigraTrueType)
 normalize a pixel to 0..1 Only has an effect on integer pixel types
template<class T>
vigra::NumericTraits< T
>::RealPromote 
normalizeValue (T v, vigra::VigraFalseType)
template<class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor, class T>
void applyMapping (vigra::triple< SrcIterator, SrcIterator, SrcAccessor > img, vigra::pair< DestIterator, DestAccessor > dest, T min, T max, int mapping)
template<class SrcImageIterator, class SrcAccessor, class DestImageIterator, class DestAccessor, class Functor>
void transformImageSpatial (SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor sa, DestImageIterator dest_upperleft, DestAccessor da, Functor const &f, vigra::Diff2D ul)
template<class SrcImageIterator, class SrcAccessor, class DestImageIterator, class DestAccessor, class Functor>
void transformImageSpatial (vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, vigra::pair< DestImageIterator, DestAccessor > dest, Functor const &f, vigra::Diff2D ul)


Detailed Description

functions to manage ROI's

Author:
Pablo d'Angelo <pablo.dangelo@web.de>
$Id$

This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License along with this software; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Definition in file utils.h.


Define Documentation

#define LUT_TRAITS T1,
 ) 
 

Value:

template<> \
struct LUTTraits<T1> \
{ \
    static T1 max() \
{ \
    return S; \
} \
}; \
template<> \
struct LUTTraits<vigra::RGBValue<T1> > \
{ \
    static T1 max() \
{ \
    return S; \
} \
};
Traits to define the maximum value for all types.

The case of float and double differs from vigra::NumericTraits::max()

Definition at line 48 of file utils.h.

#define VT_TRAITS T1   ) 
 

Value:

template<> \
struct ValueTypeTraits<T1> \
{ \
    typedef T1 value_type; \
};

Definition at line 134 of file utils.h.

#define VT_TRAITS_VEC T1   ) 
 

Value:

template<> \
struct ValueTypeTraits<vigra::RGBValue<T1, 0u, 1u, 2u> > \
{ \
    typedef vigra::RGBValue<T1, 0u, 1u, 2u>::value_type value_type; \
};

Definition at line 127 of file utils.h.


Typedef Documentation

typedef PointPairT<float> vigra_ext::PointPair
 

Definition at line 121 of file utils.h.

Referenced by vigra_ext::VigQuotientEstimator::agree(), and vigra_ext::extractRandomPoints().

typedef PointPairT<vigra::RGBValue<float> > vigra_ext::PointPairRGB
 

Definition at line 122 of file utils.h.

Referenced by loadPoints(), and loadPointsC().


Function Documentation

template<class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor, class T>
void applyMapping vigra::triple< SrcIterator, SrcIterator, SrcAccessor >  img,
vigra::pair< DestIterator, DestAccessor >  dest,
min,
max,
int  mapping
 

Definition at line 578 of file utils.h.

References vigra_ext::transformImage().

Referenced by PanoDetector::AnalyzeImage(), convertGrayToUInt8(), HuginBase::convertTo8Bit(), celeste::convertToUInt16(), convertToUInt8(), and PreviewPanel::updatePreview().

template<class SrcImageIterator, class SrcAccessor>
void circularCrop vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor >  img,
hugin_utils::FDiff2D  middle,
double  radius
 

Apply a circular crop to img.

Sets all pixels that are outside of the circle specified by middle and radius to zero.

Definition at line 388 of file utils.h.

References hugin_utils::FDiff2D, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::remapImage().

template<class V>
V getMaxComponent v  )  [inline]
 

get the maximum component of a vector (also works for single pixel types...)

Definition at line 268 of file utils.h.

Referenced by vigra_ext::ReduceToHDRFunctor< VALUETYPE >::operator()().

template<class V>
V getMaxComponent vigra::RGBValue< V > const &  v  )  [inline]
 

get the maximum component of a vector (also works for single pixel types...)

Definition at line 259 of file utils.h.

References celeste::max().

Referenced by HuginBase::AllPointSampler::sampleAllPanoPoints(), and HuginBase::RandomPointSampler::sampleRandomPanoPoints().

double getMaxValForPixelType const std::string v  )  [inline]
 

Definition at line 80 of file utils.h.

Referenced by convertGrayToUInt8(), HuginBase::convertTo8Bit(), celeste::convertToUInt16(), convertToUInt8(), HuginBase::Nona::FileRemapper< ImageType, AlphaType >::getRemapped(), and HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::remapImage().

template<class V>
V getMinComponent v  )  [inline]
 

get the maximum component of a vector (also works for single pixel types...)

Definition at line 286 of file utils.h.

template<class V>
V getMinComponent vigra::RGBValue< V > const &  v  )  [inline]
 

get the maximum component of a vector (also works for single pixel types...)

Definition at line 277 of file utils.h.

References celeste::max().

template<class V, int SIZE, class D1, class D2>
vigra::TinyVector<V, SIZE> log vigra::TinyVector< V, SIZE > const &  v,
double  e
[inline]
 

Apply log() function to each vector component.

Definition at line 247 of file utils.h.

Referenced by celeste::LogPolar::ApplyFilter(), Ransac::compute(), deghosting::Khan< PixelType >::importRGBImage(), vigra_ext::log(), log2(), HuginBase::Nona::mercator_erect(), deghosting::LogarithmFunctor< RGBValue< ComponentType > >::operator()(), deghosting::LogarithmFunctor< PixelType >::operator()(), HuginBase::PhotometricOptimizer::photometricError(), celeste::PGMImage::Read(), and celeste::sigmoid_train().

template<class T, unsigned int RIDX, unsigned int GIDX, unsigned int BIDX>
vigra::RGBValue<T, RIDX, GIDX, BIDX> log vigra::RGBValue< T, RIDX, GIDX, BIDX > const &  v  )  [inline]
 

component-wise logarithm

Definition at line 200 of file utils.h.

References vigra_ext::log().

Referenced by HuginBase::PhotometricOptimizer::photometricError().

template<class T, unsigned int RIDX, unsigned int GIDX, unsigned int BIDX>
vigra::RGBValue<T, RIDX, GIDX, BIDX> log10 vigra::RGBValue< T, RIDX, GIDX, BIDX > const &  v  )  [inline]
 

component-wise logarithm

Definition at line 209 of file utils.h.

Referenced by vigra_ext::ApplyLogFunctor::ApplyLogFunctor(), and vigra_ext::ApplyLogFunctor::operator()().

LUT_TRAITS double  ,
1.  0
 

LUT_TRAITS float  ,
1.  0
 

LUT_TRAITS signed  int,
INT_MAX 
 

LUT_TRAITS unsigned  int,
UINT_MAX 
 

LUT_TRAITS signed  short,
SHRT_MAX 
 

LUT_TRAITS unsigned  short,
USHRT_MAX 
 

LUT_TRAITS signed  char,
SCHAR_MAX 
 

LUT_TRAITS unsigned  char,
UCHAR_MAX 
 

template<class T>
vigra::NumericTraits<T>::RealPromote normalizeValue v,
vigra::VigraFalseType 
 

Definition at line 451 of file utils.h.

template<class T>
vigra::NumericTraits<T>::RealPromote normalizeValue v,
vigra::VigraTrueType 
 

normalize a pixel to 0..1 Only has an effect on integer pixel types

Definition at line 444 of file utils.h.

References celeste::max().

template<class V1, unsigned int R, unsigned int G, unsigned int B, class V2>
vigra::PromoteTraits<vigra::RGBValue<V1, R, G, B>, V2 >::Promote operator+ vigra::RGBValue< V1, R, G, B > const &  r1,
V2 const &  r2
[inline]
 

add a scalar to all components

Definition at line 220 of file utils.h.

template<class V1, unsigned int R, unsigned int G, unsigned int B, class V2>
vigra::RGBValue<V1, R, G, B>& operator+= vigra::RGBValue< V1, R, G, B > &  l,
V2 const &  r
[inline]
 

add a scalar to all components

Definition at line 188 of file utils.h.

template<class V, int SIZE, class D1, class D2>
vigra::TinyVector<V, SIZE> pow vigra::TinyVector< V, SIZE > const &  v,
double  e
[inline]
 

Apply pow() function to each vector component.

Definition at line 234 of file utils.h.

Referenced by PreviewDifferenceTool::AfterDrawImagesEvent(), vigra_ext::ApplyGammaFunctor< vigra::UInt16, vigra::UInt8 >::ApplyGammaFunctor(), HuginBase::CalculateOptimalROI::autocrop(), TextureManager::Begin(), PreviewColorPickerTool::CalcCorrectionForImage(), Ransac::compute(), vigra_ext::createGammaLUT(), HuginBase::Nona::cubeRoot_copy(), TextureManager::TextureInfo::DefineLevels(), DrawTriangle(), main(), Parser::lazy_pow_::operator()(), vigra_ext::ApplyGammaFunctor< TIn, TOut >::operator()(), optGetError(), vigra_ext::pow(), print_result(), celeste::PGMImage::Read(), HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::remapImage(), and PreviewPanel::updatePreview().

template<class T, unsigned int R, unsigned int G, unsigned int B>
vigra::RGBValue<T, R, G, B> pow vigra::RGBValue< T, R, G, B > const &  v,
double  e
[inline]
 

component-wise absolute value

Definition at line 180 of file utils.h.

References vigra_ext::pow().

float pow float  a,
double  b
[inline]
 

Definition at line 172 of file utils.h.

References vigra_ext::pow().

Referenced by vigra_ext::GammaFunctor::operator()().

template<class SrcImageIterator, class SrcAccessor, class DestImageIterator, class DestAccessor, class Functor>
void transformImageSpatial vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor >  src,
vigra::pair< DestImageIterator, DestAccessor >  dest,
Functor const &  f,
vigra::Diff2D  ul
 

Definition at line 641 of file utils.h.

template<class SrcImageIterator, class SrcAccessor, class DestImageIterator, class DestAccessor, class Functor>
void transformImageSpatial SrcImageIterator  src_upperleft,
SrcImageIterator  src_lowerright,
SrcAccessor  sa,
DestImageIterator  dest_upperleft,
DestAccessor  da,
Functor const &  f,
vigra::Diff2D  ul
 

Definition at line 618 of file utils.h.

Referenced by PreviewColorPickerTool::CalcCorrectionForImage(), and correctImage().

VT_TRAITS double   ) 
 

VT_TRAITS float   ) 
 

VT_TRAITS vigra::UInt32   ) 
 

VT_TRAITS vigra::Int32   ) 
 

VT_TRAITS vigra::UInt16   ) 
 

VT_TRAITS vigra::Int16   ) 
 

VT_TRAITS vigra::UInt8   ) 
 


Generated on Thu Apr 24 01:25:43 2014 for Hugintrunk by  doxygen 1.3.9.1