Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BIAS::FilterBase< InputStorageType, OutputStorageType > Class Template Referenceabstract

virtual parent class for API definition of all (future) filters More...

#include <Filter/FilterBase.hh>

+ Inheritance diagram for BIAS::FilterBase< InputStorageType, OutputStorageType >:
+ Collaboration diagram for BIAS::FilterBase< InputStorageType, OutputStorageType >:

Public Types

enum  TBorderHandling { TBH_full, TBH_same, TBH_valid }
 enum for border calculation, same meanings as in matlab: More...
 

Public Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
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. More...
 
bool DebugLevelIsSet (const long int lv) const
 
bool DebugLevelIsSet (const std::string &name) const
 
virtual int Filter (const Image< InputStorageType > &src, Image< OutputStorageType > &dst)=0
 prototyp for filter computation function More...
 
 FilterBase ()
 
 FilterBase (const FilterBase< InputStorageType, OutputStorageType > &other)
 
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
 
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found More...
 
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel More...
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
void SetBorderHandling (const int bh)
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
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) More...
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
virtual ~FilterBase ()
 

Static Public Member Functions

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

Protected Member Functions

long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 
virtual void GetBordersValid_ (int &border_x, int &border_y) const =0
 

Protected Attributes

int _FilterBorderHandling
 
long int _liDebugLevel
 
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class More...
 
std::map< std::string, long int > _String2Debuglevel
 

Static Protected Attributes

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

Detailed Description

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

virtual parent class for API definition of all (future) filters

Test:
TestFilterBase.hh

We would like to have a general (abstract) class FilterBase, which should be located in BIAS/Filter and which has the main function Filter(inputimage, outputimage). This enforces all our filters to have a common interface. Derived from that, we have Convolution, Gauss, Median, ... To keep the interface clean and exchangable, all Filters should be derived from FilterBase and be usable with the standard interface. The standard function checks the desired properties of the Kernel and behaves accordingly, i.e. may call the optimized subroutines, e.g. FastSobel3x3. These subroutines may also be directly called if the user knows exactly which implementation he wants. FilterBase also holds an enum for the output size, such as "full", "same" or "valid".

Author
skoglund, koeser, woelk 11/2004
Examples:
ExampleDilation.cpp, ExampleErosion.cpp, ExampleGradient.cpp, and ExampleRefineContour.cpp.

Definition at line 77 of file FilterBase.hh.

Member Enumeration Documentation

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

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 >
FilterBase::FilterBase ( )
template<class InputStorageType, class OutputStorageType>
FilterBase::FilterBase ( const FilterBase< InputStorageType, OutputStorageType > &  other)

Definition at line 49 of file FilterBase.cpp.

template<class InputStorageType , class OutputStorageType >
FilterBase::~FilterBase ( )
virtual

Definition at line 55 of file FilterBase.cpp.

Member Function Documentation

void BIAS::Debug::AddDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

template<class InputStorageType, class OutputStorageType>
void FilterBase::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.

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(), BIAS::ImageBase::GetWidth(), and BIAS::ROI_Corners.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

template<class InputStorageType, class OutputStorageType>
virtual int BIAS::FilterBase< InputStorageType, OutputStorageType >::Filter ( const Image< InputStorageType > &  src,
Image< OutputStorageType > &  dst 
)
pure virtual

prototyp for filter computation function

Implemented in BIAS::Label, BIAS::Rescale< InputST, OutputST >, BIAS::Rescale< unsigned char, unsigned char >, BIAS::Rescale< StorageType, StorageType >, BIAS::DensityFilter< InputStorageType, OutputStorageType >, BIAS::Convolution< InputStorageType, OutputStorageType >, BIAS::Convolution< float, float >, BIAS::Convolution< InputST, OutputST >, BIAS::Convolution< OutputStorageType, OutputStorageType >, BIAS::Convolution< OutputST, OutputST >, BIAS::Convolution< StorageType, StorageType >, BIAS::Convolution< unsigned char, unsigned char >, BIAS::DistTransform< InputStorageType, OutputStorageType >, BIAS::DeInterlace< InputStorageType, OutputStorageType >, BIAS::CannyEdge< InputStorageType, OutputStorageType >, BIAS::CannyEdge< InputST, OutputST >, BIAS::GradientSobel3x3< InputStorageType, OutputStorageType >, BIAS::StructureTensor< InputStorageType, OutputStorageType >, BIAS::GradientSobel3x3< InputST, OutputST >, BIAS::StructureTensor< CalculationType, CalculationType >, BIAS::GradientSimple< InputStorageType, OutputStorageType >, BIAS::HistogramEqualization< InputStorageType, OutputStorageType >, BIAS::Gauss< InputStorageType, OutputStorageType >, BIAS::Gauss< float, float >, BIAS::Gauss< InputST, OutputST >, BIAS::Gauss< OutputStorageType, OutputStorageType >, BIAS::Gauss< StorageType, StorageType >, BIAS::Gauss< unsigned char, unsigned char >, BIAS::FilterNTo2N< InputStorageType, OutputStorageType >, BIAS::FilterNTo2N< InputST, OutputST >, BIAS::FilterNTo2N< CalculationType, CalculationType >, BIAS::TukeyWindow< InputStorageType, OutputStorageType >, BIAS::GradientGaussAsymmetric< InputStorageType, OutputStorageType >, BIAS::GradientGauss< InputStorageType, OutputStorageType >, BIAS::Binomial< InputStorageType, OutputStorageType >, BIAS::Dilation< InputStorageType, OutputStorageType >, BIAS::FilterNTo3N< InputStorageType, OutputStorageType >, BIAS::FilterNToN< InputStorageType, OutputStorageType >, BIAS::GaussThreshold< InputStorageType, OutputStorageType >, BIAS::Median< InputStorageType, OutputStorageType >, BIAS::FilterNTo3N< CalculationType, CalculationType >, BIAS::FilterNToN< float, float >, BIAS::FilterNToN< StorageType, CalculationType >, BIAS::FilterNToN< InputST, OutputST >, BIAS::FilterNToN< OutputStorageType, OutputStorageType >, BIAS::FilterNToN< OutputST, OutputST >, BIAS::FilterNToN< unsigned char, unsigned char >, BIAS::FilterNToN< StorageType, StorageType >, BIAS::Median< InputST, OutputST >, BIAS::Erosion< InputStorageType, OutputStorageType >, BIAS::Mean< InputStorageType, OutputStorageType >, BIAS::Thinning< InputStorageType, OutputStorageType >, BIAS::Mean< InputST, OutputST >, BIAS::CensusTransform< InputStorageType, OutputStorageType >, and BIAS::Bilateral< InputStorageType, OutputStorageType >.

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

Definition at line 129 of file FilterBase.hh.

template<class InputStorageType , class OutputStorageType >
void FilterBase::GetBorders ( int &  border_x,
int &  border_y 
) const
template<class InputStorageType, class OutputStorageType>
virtual void BIAS::FilterBase< InputStorageType, OutputStorageType >::GetBordersValid_ ( int &  border_x,
int &  border_y 
) const
protectedpure virtual

Implemented in BIAS::Rescale< InputStorageType, OutputStorageType >, BIAS::Rescale< InputST, OutputST >, BIAS::Rescale< unsigned char, unsigned char >, BIAS::Rescale< StorageType, StorageType >, BIAS::StructureTensor< InputStorageType, OutputStorageType >, BIAS::StructureTensor< CalculationType, CalculationType >, BIAS::Label, BIAS::Median< InputStorageType, OutputStorageType >, BIAS::Median< InputST, OutputST >, BIAS::Convolution< InputStorageType, OutputStorageType >, BIAS::Convolution< float, float >, BIAS::Convolution< InputST, OutputST >, BIAS::Convolution< OutputStorageType, OutputStorageType >, BIAS::Convolution< OutputST, OutputST >, BIAS::Convolution< StorageType, StorageType >, BIAS::Convolution< unsigned char, unsigned char >, BIAS::GradientSimple< InputStorageType, OutputStorageType >, BIAS::Binomial< InputStorageType, OutputStorageType >, BIAS::GradientSobel3x3< InputStorageType, OutputStorageType >, BIAS::GradientSobel3x3< InputST, OutputST >, BIAS::Bilateral< InputStorageType, OutputStorageType >, BIAS::GradientGauss< InputStorageType, OutputStorageType >, BIAS::DeInterlace< InputStorageType, OutputStorageType >, BIAS::DensityFilter< InputStorageType, OutputStorageType >, BIAS::Mean< InputStorageType, OutputStorageType >, BIAS::Mean< InputST, OutputST >, BIAS::HessianGauss< InputStorageType, OutputStorageType >, BIAS::Dilation< InputStorageType, OutputStorageType >, BIAS::HessianSimple< InputStorageType, OutputStorageType >, BIAS::DistTransform< InputStorageType, OutputStorageType >, BIAS::HistogramEqualization< InputStorageType, OutputStorageType >, BIAS::TukeyWindow< InputStorageType, OutputStorageType >, BIAS::CannyEdge< InputStorageType, OutputStorageType >, BIAS::CannyEdge< InputST, OutputST >, BIAS::Erosion< InputStorageType, OutputStorageType >, BIAS::Thinning< InputStorageType, OutputStorageType >, and BIAS::CensusTransform< InputStorageType, OutputStorageType >.

int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

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

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

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

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

template<class InputStorageType , class OutputStorageType>
void FilterBase::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)

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(), BIAS::ImageBase::GetWidth(), and BIAS::ROI_Corners.

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

Member Data Documentation

template<class InputStorageType, class OutputStorageType>
int BIAS::FilterBase< InputStorageType, OutputStorageType >::_FilterBorderHandling
protected
long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

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

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

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

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

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

std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

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

long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.


The documentation for this class was generated from the following files: