Basic Image AlgorithmS Library 2.8.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

BIAS::GradientGaussAsymmetric< InputStorageType, OutputStorageType > Class Template Reference

gradient calculation with separated gauss masks More...

#include <Filter/GradientGaussAsymmetric.hh>

Inheritance diagram for BIAS::GradientGaussAsymmetric< InputStorageType, OutputStorageType >:
Collaboration diagram for BIAS::GradientGaussAsymmetric< InputStorageType, OutputStorageType >:

List of all members.

Public Types

enum  EVecLengthType { VLT_L1, VLT_L2, VLT_max }
 

algorithm used to calculate the absolute length of the 2D vector

  • VLT_L1: | fabs(gx) + fabs(gy) |
  • VLT_L2: sqrt(gx*gx+gy*gy)
  • VLT_max: max(fabs(gx), fabs(gy))
More...
enum  TBorderHandling { TBH_full, TBH_same, TBH_valid }
 

enum for border calculation, same meanings as in matlab:

  • TBH_valid: returns only the pixels whose values can be computed without using zero padding of the input image.
More...

Public Member Functions

void AddDebugLevel (const long int lv)
void AddDebugLevel (const std::string &name)
virtual FilterNTo2N
< InputStorageType,
OutputStorageType > * 
Clone () const
void CopyNonROIFromSource (const Image< InputStorageType > &src, Image< OutputStorageType > &dst) const
 run over all pixel which do not belong to the roi and set them to the value in the source image regardless of the roi of the source.
bool DebugLevelIsSet (const long int lv) const
bool DebugLevelIsSet (const std::string &name) const
virtual int Filter (const Image< InputStorageType > &src, Image< OutputStorageType > &gx, Image< OutputStorageType > &gy)
 dstX.GetChannelCount()==src.GetCHannelCount()
virtual int Filter (const Image< InputStorageType > &src, Image< OutputStorageType > &gx, Image< OutputStorageType > &gy, Image< OutputStorageType > &absg)
virtual int Filter (const Image< InputStorageType > &src, Image< OutputStorageType > &grad)
 returns a 2 channel image containing gx and gy
virtual int FilterFloat (const Image< InputStorageType > &src, Image< OutputStorageType > &dst1, Image< OutputStorageType > &dst2)
virtual int FilterFloat (const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
virtual int FilterInt (const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
virtual int FilterInt (const Image< InputStorageType > &src, Image< OutputStorageType > &dst1, Image< OutputStorageType > &dst2)
int GetBorderHandling () const
void GetBorders (int &border_x, int &border_y) const
int GetDebugLevel () const
std::ostream & GetDebugStream () const
void GetDebugStream (std::ostream &os) const
double GetGradGaussRatio () const
double GetGradGaussSigma () const
 GradientGaussAsymmetric (const GradientGaussAsymmetric< InputStorageType, OutputStorageType > &other)
 GradientGaussAsymmetric ()
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel
void PrintDebugLevel (std::ostream &os=std::cout) const
void PrintKernel () const
void RemoveDebugLevel (const long int lv)
void RemoveDebugLevel (const std::string &name)
void SetBorderHandling (const int bh)
void SetDebugLevel (const std::string &name)
void SetDebugLevel (const long int lv)
void SetDebugStream (const std::ostream &os)
void SetGradGaussRatio (const double ratio)
void SetGradGaussSigma (const double sigma)
void SetNonROIToValue (Image< OutputStorageType > &dst, const std::vector< OutputStorageType > &t) const
 run over all pixel which do not belong to the roi and set them to some value (typically black)
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels
int VecLen (const Image< OutputStorageType > &gx, const Image< OutputStorageType > &gy, Image< OutputStorageType > &length)
 decides which vector length to use from *_VecLenthType
int VecLenL1 (const Image< OutputStorageType > &gx, const Image< OutputStorageType > &gy, Image< OutputStorageType > &length)
 length = | fabs(gx) + fabs(gy) | destination absg must be initialized
int VecLenL2 (const Image< OutputStorageType > &gx, const Image< OutputStorageType > &gy, Image< OutputStorageType > &length)
 length = sqrt(gx*gx+gy*gy) destination absg must be initialized
int VecLenMax (const Image< OutputStorageType > &gx, const Image< OutputStorageType > &gy, Image< OutputStorageType > &length)
 length = max(fabs(gx),fabs(gy)) destination absg must be initialized
virtual ~GradientGaussAsymmetric ()

Static Public Member Functions

static long int GetGlobalDebugLevel ()
static void SetGlobalDebugLevel (long int lev)

Protected Member Functions

void _CalculateKernels (double Sigma, double Ratio)
 Fills _HVec with gaussian function and _VVec with derivative of gaussian function with standard deviation Sigma.
long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel
virtual void GetBordersValid_ (int &border_x, int &border_y) const

Protected Attributes

Convolution< InputStorageType,
OutputStorageType > 
_Conv
 computation object to execute the convolution
int _FilterBorderHandling
double _GradGaussRatio
double _GradGaussSigma
 the parameters
double _LastRatio
double _LastSigma
 the parameters at the time of the last call
long int _liDebugLevel
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class
std::map< std::string, long int > _String2Debuglevel
int _VecLengthType
 of type Gradient<InputStorageType, OutputStorageType>::EVecLengthType

Static Protected Attributes

static std::ostream _zDebugStream
static long int GlobalDebugLevel = 0

Detailed Description

template<class InputStorageType, class OutputStorageType>
class BIAS::GradientGaussAsymmetric< InputStorageType, OutputStorageType >

gradient calculation with separated gauss masks

Author:
woelk 09/2004
Examples:

ExampleGradient.cpp, ExampleRefineContour.cpp, and ExampleTrackerBase.cpp.

Definition at line 44 of file GradientGaussAsymmetric.hh.


Member Enumeration Documentation

template<class InputStorageType, class OutputStorageType>
enum BIAS::FilterNTo2N::EVecLengthType [inherited]

algorithm used to calculate the absolute length of the 2D vector

  • VLT_L1: | fabs(gx) + fabs(gy) |
  • VLT_L2: sqrt(gx*gx+gy*gy)
  • VLT_max: max(fabs(gx), fabs(gy))

Enumerator:
VLT_L1 
VLT_L2 
VLT_max 

Definition at line 52 of file FilterNTo2N.hh.

template<class InputStorageType, class OutputStorageType>
enum BIAS::FilterBase::TBorderHandling [inherited]

enum for border calculation, same meanings as in matlab:

  • TBH_valid: returns only the pixels whose values can be computed without using zero padding of the input image.

The resulting output image is smaller than the input image. The ROI of the output image is set accordingly.

  • TBH_same: returns the set of pixels that can be computed by applying the filter to all pixels that are actually part of the input image. Border pixels are computed using zero padding, but the center pixel of the computational kernel is applied only to pixels in the image. This results in an output image that is the same size as the input image.
  • TBH_full: returns the full convolution. This means conv2 returns all pixels for which any of the pixels in the computational molecule overlap pixels in the image, even when the center pixel is outside the input image. The resulting output image is larger than the input image. This is not implemented at the moment.
Enumerator:
TBH_full 
TBH_same 
TBH_valid 

Definition at line 98 of file FilterBase.hh.


Constructor & Destructor Documentation

template<class InputStorageType , class OutputStorageType >
GradientGaussAsymmetric::GradientGaussAsymmetric ( )

Definition at line 37 of file GradientGaussAsymmetric.cpp.

template<class InputStorageType , class OutputStorageType >
GradientGaussAsymmetric::GradientGaussAsymmetric ( const GradientGaussAsymmetric< InputStorageType, OutputStorageType > &  other)

Definition at line 43 of file GradientGaussAsymmetric.cpp.

template<class InputStorageType , class OutputStorageType >
GradientGaussAsymmetric::~GradientGaussAsymmetric ( ) [virtual]

Definition at line 48 of file GradientGaussAsymmetric.cpp.


Member Function Documentation

template<class InputStorageType , class OutputStorageType >
void GradientGaussAsymmetric::_CalculateKernels ( double  Sigma,
double  Ratio 
) [protected]

Fills _HVec with gaussian function and _VVec with derivative of gaussian function with standard deviation Sigma.

The size of _HVec and _VVec is calculated by using Ration. The Gaussian function is truncated, when the ration between biggest and smalles entry falls below Ratio.

Author:
woelk 09/2004

Todo:
check if this is a proper filter mask in the sense of convolution -> reflection at center. We might have introduced an inconsistency here when switching to generic convolution.

Reimplemented from BIAS::GradientGauss< InputStorageType, OutputStorageType >.

Definition at line 149 of file GradientGaussAsymmetric.cpp.

References BIAS::FilterMask::ComputeIntPrecisionBits(), and BIAS::FilterMask::CreateIntFilter().

void BIAS::Debug::AddDebugLevel ( const long int  lv) [inline, inherited]
void BIAS::Debug::AddDebugLevel ( const std::string &  name) [inline, inherited]

Definition at line 363 of file Debug.hh.

template<class InputStorageType, class OutputStorageType>
virtual FilterNTo2N<InputStorageType, OutputStorageType>* BIAS::GradientGaussAsymmetric< InputStorageType, OutputStorageType >::Clone ( ) const [inline, virtual]
long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( ) [inline, protected, inherited]

returns the next available debuglevel

Author:
woelk 09/2006

Definition at line 522 of file Debug.hh.

template<class InputStorageType, class OutputStorageType>
void FilterBase::CopyNonROIFromSource ( const Image< InputStorageType > &  src,
Image< OutputStorageType > &  dst 
) const [inherited]

run over all pixel which do not belong to the roi and set them to the value in the source image regardless of the roi of the source.

Both images must have same size.

Author:
koeser 12/2008

Definition at line 135 of file FilterBase.cpp.

References BIAS::ImageBase::GetChannelCount(), BIAS::ROI::GetCorners(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetROI(), and BIAS::ImageBase::GetWidth().

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const [inline, inherited]
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const [inline, inherited]

Definition at line 351 of file Debug.hh.

template<class InputStorageType , class OutputStorageType >
int GradientGaussAsymmetric::Filter ( const Image< InputStorageType > &  src,
Image< OutputStorageType > &  dst1,
Image< OutputStorageType > &  dst2 
) [virtual]
template<class InputStorageType , class OutputStorageType >
int GradientGaussAsymmetric::Filter ( const Image< InputStorageType > &  src,
Image< OutputStorageType > &  grad 
) [virtual]

returns a 2 channel image containing gx and gy

Author:
woelk 12/2004, untested

Reimplemented from BIAS::GradientGauss< InputStorageType, OutputStorageType >.

Definition at line 87 of file GradientGaussAsymmetric.cpp.

References BIAS::Image< StorageType >::AppendChannel().

template<class InputStorageType , class OutputStorageType >
int GradientGaussAsymmetric::Filter ( const Image< InputStorageType > &  src,
Image< OutputStorageType > &  gx,
Image< OutputStorageType > &  gy,
Image< OutputStorageType > &  absg 
) [virtual]
template<class InputStorageType, class OutputStorageType>
int FilterNTo2N::FilterFloat ( const Image< InputStorageType > &  src,
Image< OutputStorageType > &  dst 
) [virtual, inherited]

Definition at line 74 of file FilterNTo2N.cpp.

template<class InputStorageType, class OutputStorageType>
int FilterNTo2N::FilterFloat ( const Image< InputStorageType > &  src,
Image< OutputStorageType > &  dst1,
Image< OutputStorageType > &  dst2 
) [virtual, inherited]

Definition at line 100 of file FilterNTo2N.cpp.

template<class InputStorageType, class OutputStorageType>
int FilterNTo2N::FilterInt ( const Image< InputStorageType > &  src,
Image< OutputStorageType > &  dst 
) [virtual, inherited]

Definition at line 66 of file FilterNTo2N.cpp.

template<class InputStorageType, class OutputStorageType>
int FilterNTo2N::FilterInt ( const Image< InputStorageType > &  src,
Image< OutputStorageType > &  dst1,
Image< OutputStorageType > &  dst2 
) [virtual, inherited]

Definition at line 91 of file FilterNTo2N.cpp.

template<class InputStorageType, class OutputStorageType>
int BIAS::FilterBase< InputStorageType, OutputStorageType >::GetBorderHandling ( ) const [inline, inherited]

Definition at line 129 of file FilterBase.hh.

template<class InputStorageType , class OutputStorageType >
void FilterBase::GetBorders ( int &  border_x,
int &  border_y 
) const [inherited]
template<class InputStorageType , class OutputStorageType >
void GradientGauss::GetBordersValid_ ( int &  border_x,
int &  border_y 
) const [protected, virtual, inherited]
int BIAS::Debug::GetDebugLevel ( ) const [inline, inherited]
std::ostream& BIAS::Debug::GetDebugStream ( ) const [inline, inherited]

Definition at line 406 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const [inline, inherited]

Definition at line 415 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( ) [inline, static, inherited]

Definition at line 432 of file Debug.hh.

template<class InputStorageType, class OutputStorageType>
double BIAS::GradientGauss< InputStorageType, OutputStorageType >::GetGradGaussRatio ( ) const [inline, inherited]

Definition at line 78 of file GradientGauss.hh.

template<class InputStorageType, class OutputStorageType>
double BIAS::GradientGauss< InputStorageType, OutputStorageType >::GetGradGaussSigma ( ) const [inline, inherited]

Definition at line 73 of file GradientGauss.hh.

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const [inline, inherited]

looks up a debuglevel in the internal map, returns 0 if not found

Author:
woelk 09/2006

Definition at line 455 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name) [inline, inherited]
void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const [inline, inherited]

Definition at line 384 of file Debug.hh.

template<class InputStorageType, class OutputStorageType>
void BIAS::GradientGauss< InputStorageType, OutputStorageType >::PrintKernel ( ) const [inline, inherited]

Definition at line 80 of file GradientGauss.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name) [inline, inherited]

Definition at line 377 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv) [inline, inherited]

Definition at line 370 of file Debug.hh.

template<class InputStorageType, class OutputStorageType>
void BIAS::FilterBase< InputStorageType, OutputStorageType >::SetBorderHandling ( const int  bh) [inline, inherited]
void BIAS::Debug::SetDebugLevel ( const long int  lv) [inline, inherited]
void BIAS::Debug::SetDebugLevel ( const std::string &  name) [inline, inherited]

Definition at line 326 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os) [inline, inherited]

Definition at line 399 of file Debug.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev) [inline, static, inherited]

Definition at line 425 of file Debug.hh.

template<class InputStorageType, class OutputStorageType>
void BIAS::GradientGauss< InputStorageType, OutputStorageType >::SetGradGaussRatio ( const double  ratio) [inline, inherited]

Definition at line 75 of file GradientGauss.hh.

template<class InputStorageType, class OutputStorageType>
void BIAS::GradientGauss< InputStorageType, OutputStorageType >::SetGradGaussSigma ( const double  sigma) [inline, inherited]

Definition at line 70 of file GradientGauss.hh.

template<class InputStorageType , class OutputStorageType>
void FilterBase::SetNonROIToValue ( Image< OutputStorageType > &  dst,
const std::vector< OutputStorageType > &  t 
) const [inherited]

run over all pixel which do not belong to the roi and set them to some value (typically black)

Author:
koeser 12/2008

Definition at line 84 of file FilterBase.cpp.

References BIAS::ImageBase::GetChannelCount(), BIAS::ROI::GetCorners(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetROI(), and BIAS::ImageBase::GetWidth().

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const [inline, inherited]

prints all internally known debuglevels

Author:
woelk 09/2006

Definition at line 497 of file Debug.hh.

template<class InputStorageType , class OutputStorageType>
int FilterNTo2N::VecLen ( const Image< OutputStorageType > &  gx,
const Image< OutputStorageType > &  gy,
Image< OutputStorageType > &  length 
) [inherited]

decides which vector length to use from *_VecLenthType

Author:
woelk 12/2004

Definition at line 114 of file FilterNTo2N.cpp.

template<class InputStorageType , class OutputStorageType>
int FilterNTo2N::VecLenL1 ( const Image< OutputStorageType > &  gx,
const Image< OutputStorageType > &  gy,
Image< OutputStorageType > &  length 
) [inherited]

length = | fabs(gx) + fabs(gy) | destination absg must be initialized

Author:
woelk 09/2004

Definition at line 140 of file FilterNTo2N.cpp.

References BIAS::ROI::GetCorners(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetROI(), and BIAS::ROI::SetCorners().

template<class InputStorageType , class OutputStorageType>
int FilterNTo2N::VecLenL2 ( const Image< OutputStorageType > &  gx,
const Image< OutputStorageType > &  gy,
Image< OutputStorageType > &  length 
) [inherited]

length = sqrt(gx*gx+gy*gy) destination absg must be initialized

Author:
woelk 09/2004

Definition at line 172 of file FilterNTo2N.cpp.

References BIAS::ROI::GetCorners(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetROI(), and BIAS::ROI::SetCorners().

template<class InputStorageType , class OutputStorageType>
int FilterNTo2N::VecLenMax ( const Image< OutputStorageType > &  gx,
const Image< OutputStorageType > &  gy,
Image< OutputStorageType > &  length 
) [inherited]

length = max(fabs(gx),fabs(gy)) destination absg must be initialized

Author:
woelk 09/2004

Definition at line 205 of file FilterNTo2N.cpp.

References BIAS::ROI::GetCorners(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetROI(), and BIAS::ROI::SetCorners().


Member Data Documentation

template<class InputStorageType, class OutputStorageType>
Convolution<InputStorageType, OutputStorageType> BIAS::GradientGauss< InputStorageType, OutputStorageType >::_Conv [protected, inherited]

computation object to execute the convolution

Definition at line 89 of file GradientGauss.hh.

template<class InputStorageType, class OutputStorageType>
int BIAS::FilterBase< InputStorageType, OutputStorageType >::_FilterBorderHandling [protected, inherited]
template<class InputStorageType, class OutputStorageType>
double BIAS::GradientGauss< InputStorageType, OutputStorageType >::_GradGaussRatio [protected, inherited]

Definition at line 85 of file GradientGauss.hh.

template<class InputStorageType, class OutputStorageType>
double BIAS::GradientGauss< InputStorageType, OutputStorageType >::_GradGaussSigma [protected, inherited]

the parameters

Definition at line 85 of file GradientGauss.hh.

template<class InputStorageType, class OutputStorageType>
double BIAS::GradientGauss< InputStorageType, OutputStorageType >::_LastRatio [protected, inherited]

Definition at line 87 of file GradientGauss.hh.

template<class InputStorageType, class OutputStorageType>
double BIAS::GradientGauss< InputStorageType, OutputStorageType >::_LastSigma [protected, inherited]

the parameters at the time of the last call

Definition at line 87 of file GradientGauss.hh.

long int BIAS::Debug::_liDebugLevel [protected, inherited]

Definition at line 511 of file Debug.hh.

Referenced by BIAS::ImageBase::operator=(), and BIAS::Debug::operator=().

long int BIAS::Debug::_liNextDebugLevel [protected, inherited]

new concept, debuglevel are managed here in the debug class

Definition at line 517 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel [protected, inherited]

Definition at line 518 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

template<class InputStorageType, class OutputStorageType>
int BIAS::FilterNTo2N< InputStorageType, OutputStorageType >::_VecLengthType [protected, inherited]

of type Gradient<InputStorageType, OutputStorageType>::EVecLengthType

Definition at line 107 of file FilterNTo2N.hh.

Referenced by BIAS::FilterNTo2N< InputStorageType, OutputStorageType >::FilterNTo2N().

std::ostream BIAS::Debug::_zDebugStream [static, protected, inherited]

Definition at line 512 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

long int BIAS::Debug::GlobalDebugLevel = 0 [static, protected, inherited]

Definition at line 514 of file Debug.hh.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends