Public Member Functions | Private Member Functions | Private Attributes
puma2::MedianFilter< T > Class Template Reference

This class implements a basic median filter for images. More...

#include <MedianFilter.h>

Inheritance diagram for puma2::MedianFilter< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void apply (const T &iImg, T &oImg)
int getWindowHeight () const
int getWindowWidth () const
 MedianFilter (int windowWidth, int windowHeight)
 MedianFilter (int windowSize)
virtual ~MedianFilter ()

Private Member Functions

void computeHelpers ()

Private Attributes

int mHalfWindowHeight
int mHalfWindowWidth
int mMedianIndex
int mNumWindowElements
T::ElementType * mWindowElements
int mWindowHeight
int mWindowWidth

Detailed Description

template<class T>
class puma2::MedianFilter< T >

This class implements a basic median filter for images.

Author:
Richard Arndt
Stephan Wirth

This class implements a basic median filter for single channel images. If it is used for multi-channel images, it will be applied per channel and a warning will be produced. The median filter will only be applied to image elements where the filter window fits completely into the image, i.e. if the window has width and height of five, the first and the last two rows and colums will not be filtered.

Definition at line 25 of file MedianFilter.h.


Constructor & Destructor Documentation

template<class T >
puma2::MedianFilter< T >::MedianFilter ( int  windowWidth,
int  windowHeight 
)

Constructor. Sets width and height of the median filter window.

Parameters:
windowWidthWidth of the window of the median filter
windowHeightHeight of the window of the median filter

Definition at line 126 of file MedianFilter.h.

template<class T >
puma2::MedianFilter< T >::MedianFilter ( int  windowSize)

Constructor for sqare windows. Sets height and width of the median filter window to windowSize.

Parameters:
windowSizeSize of the median filter window (width and height)

Definition at line 109 of file MedianFilter.h.

template<class T >
puma2::MedianFilter< T >::~MedianFilter ( ) [virtual]

Destructor deletes dynamically allocated memory.

Definition at line 155 of file MedianFilter.h.


Member Function Documentation

template<class T >
void puma2::MedianFilter< T >::apply ( const T &  iImg,
T &  oImg 
) [virtual]

Do the real work of the operator

Implements puma2::ImageToImageOperator< T, T >.

Definition at line 167 of file MedianFilter.h.

template<class T >
void puma2::MedianFilter< T >::computeHelpers ( ) [private]

Computes the helpers for the apply() function. This function is called in the constructors. The members mHalfWindowWidth, mHalfWindowHeight, mNumWindowElements and mMedianIndex will be computed and the memory for mWindowElements will be allocated.

Definition at line 146 of file MedianFilter.h.

template<class T >
int puma2::MedianFilter< T >::getWindowHeight ( ) const [inline]
Returns:
Height of the median filter window

Definition at line 60 of file MedianFilter.h.

template<class T >
int puma2::MedianFilter< T >::getWindowWidth ( ) const [inline]
Returns:
Width of the median filter window

Definition at line 55 of file MedianFilter.h.


Member Data Documentation

template<class T >
int puma2::MedianFilter< T >::mHalfWindowHeight [private]

Stores (mWindowHeight - 1) / 2

Definition at line 89 of file MedianFilter.h.

template<class T >
int puma2::MedianFilter< T >::mHalfWindowWidth [private]

Stores (mWindowWidth - 1) / 2

Definition at line 84 of file MedianFilter.h.

template<class T >
int puma2::MedianFilter< T >::mMedianIndex [private]

Stores the index of the median in mWindowElements (mNumWindowElements / 2)

Definition at line 104 of file MedianFilter.h.

template<class T >
int puma2::MedianFilter< T >::mNumWindowElements [private]

Stores the number of elements in the window (mWindowHeight * mWindowWidth).

Definition at line 94 of file MedianFilter.h.

template<class T >
T::ElementType* puma2::MedianFilter< T >::mWindowElements [private]

Stores the window elements.

Definition at line 99 of file MedianFilter.h.

template<class T >
int puma2::MedianFilter< T >::mWindowHeight [private]

Stores the height of the filter window

Definition at line 79 of file MedianFilter.h.

template<class T >
int puma2::MedianFilter< T >::mWindowWidth [private]

Stores the width of the filter window

Definition at line 74 of file MedianFilter.h.


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


obj_rec_gui
Author(s): AGAS/agas@uni-koblenz.de
autogenerated on Mon Oct 6 2014 02:53:44