STIRA  0.1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
stira::imagedata::Pyramid< T > Class Template Reference

A data class to contain all subbands of a pyramid decomposition These bands are grouped per resolution level. All bands in one resolution level are grouped in a member class PyramidLevel. So, a pyramid contains a vector of pointers to "PyramidLevel" objects for the recursive scales and an extra pointer to a "PyramidLevel" object for the residual scale (like used in the steerable pyramid, is NULL if no residual scale is used) More...

#include <Pyramid.h>

Public Types

enum  PyramidSubsamplingArgument { IS_SUBSAMPLED, IS_REDUNDANT }
 
enum  PyramidResidualLevelsArgument { HAS_RESIDUALLEVELS, HAS_NO_RESIDUALLEVELS }
 

Public Member Functions

 Pyramid (ArrayGrid< double > *pSourceBand, int myNrScales, int myNrOrientations, bool isSubsampled, bool needsResidualLevels, bool isFinestScaleSubsampled=false)
 Constructor. Creates an empty data structure to which the bands (allocated elsewhere) can be added. More...
 
bool CreateBands (int sourceWidth, int sourceHeight, bool isSubsampled=false, bool isFinestScaleSubsampled=false)
 creates bands and allocates the necessary memory for the bands More...
 
 ~Pyramid ()
 Destructor.
 
int GetNumberOfScales ()
 Gets the number of scales in this pyramid This is the number of recursive scales in this pyramid and does NOT count the residual level if it is present!!
 
int GetNumberOfOrientations ()
 Gets the number of orientations in this pyramid.
 
int GetSourceDataWidth ()
 Gets the width of the underlying source data grid.
 
int GetSourceDataHeight ()
 Gets the height of the underlying source data grid.
 
double GetScaleFactorResidualLevel ()
 Gets the scale factor for the residual level Takes into account scaling of the energy content from level to level due to normalization of the coefficients.
 
void SetScaleFactorResidualLevel (double factor)
 Sets the scale factor for the residual level Takes into account scaling of the energy content from level to level due to normalization of the coefficients. More...
 
double GetScaleFactorResidualToRecursiveLevel ()
 Gets the scale factor between the residual and the first recursive level Takes into account scaling of the energy content from level to level due to normalization of the coefficients.
 
void SetScaleFactorResidualToRecursiveLevel (double factor)
 Sets the scale factor between the residual and the first recursive level Takes into account scaling of the energy content from level to level due to normalization of the coefficients. More...
 
double GetScaleFactorRecursiveLevel ()
 Gets the scale factor between two adjacent recursive levels Takes into account scaling of the energy content from level to level due to normalization of the coefficients.
 
void SetScaleFactorRecursiveLevel (double factor)
 Gets the scale factor between two adjacent recursive levels Takes into account scaling of the energy content from level to level due to normalization of the coefficients. More...
 
PyramidLevel< T > * GetRecursiveScale (int scale)
 Gets a list of oriented subbands belonging to a recursive scale of the pyramid. More...
 
bool HasResidualScale ()
 checks if the pyramid has a residual scale
 
int GetFinestScaleNumber ()
 gets number of finest scale Is 0 for standard decomposition; is -1 when residual scale is available like with complete steerable pyramid
 
PyramidLevel< T > * GetResidualScale ()
 Gets a list of oriented subbands belonging to the finest residual scale of the pyramid.
 
ArrayGrid< double > * GetLowpassResidual ()
 Gets the lowpass residual after decomposition.
 
void SetLowpassResidual (ArrayGrid< double > *pGrid)
 sets the current lowpass residual by pGrid If no lowpass residual was present, the input grid is set; if one was present, it is deleted and replaced More...
 
Pyramid< T > * Clone ()
 writes all bands in all levels to PGM's More...
 
void CopyValuesFrom (Pyramid< T > *pOtherPyramid)
 Copies the values in the bands of "pOtherPyramid" to the bands in this pyramid Pyramids must have equal number of scales and orientations and sizes per band. No new objects or memory is allocated!!! More...
 
GetAverageConeRatioSubSampled (int x, int y, int orientationNr, int coarsestScale, int finestScale)
 computes the so-called Average Cone Ratio of pyramid coefficients in case the pyramid is subsampled More...
 
GetAverageConeRatioRedundant (int x, int y, int orientationNr, int coarsestScale, int finestScale)
 computes the so-called Average Cone Ratio of pyramid coefficients in case the pyramid is redundant (ie, not subsampled) More...
 
bool IsSubsampled ()
 gets flag whether coarser scales are subsampled true if decomposition is subsampled to coarser levels; false if representation is not subsampled
 
bool IsFinestScaleSubsampled ()
 

Protected Member Functions

ArrayGrid< T > * DownSampleGrid (ArrayGrid< T > *pBandIn)
 downsamples a given band The caller gets a newly created band, and is responsible for deleting it after usage More...
 
ArrayGrid< T > * UpSampleGrid (ArrayGrid< T > *pBandIn, int upSampledWidth, int upSampledHeight)
 Upsamples a band The caller gets a newly created band, and is responsible for deleting it after usage. Because of the ambiguity (both width 2n-1 and 2n were downsampled to new width n), the upsampled width and height need to be specified. More...
 

Protected Attributes

std::vector< PyramidLevel< T > * > mvpRecursivePyramidLevels
 oriented bandpass bands for all recursive scales
 
PyramidLevel< T > * mpResidualPyramidLevels
 oriented bandpass bands for the residual highpass scale
 
ArrayGrid< double > * mpLowPassResidual
 Band with final lowpass residual of the pyramid.
 
ArrayGrid< double > * mpSourceDataGrid
 pointer to the grid with the source data
 
bool mIsSubsampled
 
bool mIsFinestScaleSubsampled
 
int mNrScales
 number of (recursive) scales in this pyramid; doesn't count the residual level if it is present!!
 
int mNrOrientations
 number of orientations in this pyramid
 
double mScaleFactorResidualLevel
 scale factor normal noise variance in spatial domain and in recursive level
 
double mScaleFactorResidualToRecursiveLevel
 scale factor coefficients between residual and first recursive level
 
double mScaleFactorRecursiveLevel
 scale factor coefficients between two successive recursive levels
 

Detailed Description

template<class T>
class stira::imagedata::Pyramid< T >

A data class to contain all subbands of a pyramid decomposition These bands are grouped per resolution level. All bands in one resolution level are grouped in a member class PyramidLevel. So, a pyramid contains a vector of pointers to "PyramidLevel" objects for the recursive scales and an extra pointer to a "PyramidLevel" object for the residual scale (like used in the steerable pyramid, is NULL if no residual scale is used)

Constructor & Destructor Documentation

template<class T >
stira::imagedata::Pyramid< T >::Pyramid ( ArrayGrid< double > *  pSourceBand,
int  myNrScales,
int  myNrOrientations,
bool  isSubsampled,
bool  needsResidualLevels,
bool  isFinestScaleSubsampled = false 
)

Constructor. Creates an empty data structure to which the bands (allocated elsewhere) can be added.

Parameters
pSourceBandinput data
myNrScalesnr of scales in pyramid
myNrOrientationsnr of orientations
isSubsampledtrue if decomposition is subsampled to higher levels; false if representation is not subsampled
needsResidualLevelsflag if residual levels are required (true for steerable pyramid, false for normal wavelets)

References stira::imagedata::Pyramid< T >::mNrOrientations, stira::imagedata::Pyramid< T >::mNrScales, stira::imagedata::Pyramid< T >::mpLowPassResidual, stira::imagedata::Pyramid< T >::mpResidualPyramidLevels, stira::imagedata::Pyramid< T >::mpSourceDataGrid, stira::imagedata::Pyramid< T >::mScaleFactorRecursiveLevel, stira::imagedata::Pyramid< T >::mScaleFactorResidualLevel, stira::imagedata::Pyramid< T >::mScaleFactorResidualToRecursiveLevel, and stira::imagedata::Pyramid< T >::mvpRecursivePyramidLevels.

Referenced by stira::imagedata::Pyramid< T >::Clone().

Member Function Documentation

template<class T >
Pyramid< T > * stira::imagedata::Pyramid< T >::Clone ( )
template<class T>
void stira::imagedata::Pyramid< T >::CopyValuesFrom ( Pyramid< T > *  pOtherPyramid)
template<class T >
bool stira::imagedata::Pyramid< T >::CreateBands ( int  sourceWidth,
int  sourceHeight,
bool  isSubsampled = false,
bool  isFinestScaleSubsampled = false 
)

creates bands and allocates the necessary memory for the bands

Parameters
sourceWidthwidth of data grid at full resolution
sourceHeightheight of data grid at full resolution
isSubsampledflag if bands are subsampled or not
isFinestScaleSubsampled(for steerable pyramid) in case of subsampling indicates if first scale is subsampled or not
Returns
true if bands were created successfully

References stira::imagedata::PyramidLevel< T >::AddOrientedBand(), stira::common::MathUtils::ComputeIntegerPower(), stira::imagedata::Pyramid< T >::mNrOrientations, stira::imagedata::Pyramid< T >::mNrScales, stira::imagedata::Pyramid< T >::mpLowPassResidual, stira::imagedata::Pyramid< T >::mpResidualPyramidLevels, and stira::imagedata::Pyramid< T >::mvpRecursivePyramidLevels.

Referenced by stira::wavelet::Wavelet::Initialize().

template<class T>
ArrayGrid<T>* stira::imagedata::Pyramid< T >::DownSampleGrid ( ArrayGrid< T > *  pBandIn)
protected

downsamples a given band The caller gets a newly created band, and is responsible for deleting it after usage

Parameters
pBandInthe band to be downsampled
template<class T >
T stira::imagedata::Pyramid< T >::GetAverageConeRatioRedundant ( int  x,
int  y,
int  orientationNr,
int  coarsestScale,
int  finestScale 
)

computes the so-called Average Cone Ratio of pyramid coefficients in case the pyramid is redundant (ie, not subsampled)

Ref: PhD thesis A. Pizurica "Image Denoising Using Wavelets and Spatial Context Modeling" p. 87 http://telin.ugent.be/~sanja/

Parameters
xx coordinate of the coefficient
yy coordinate of the coefficient
orientationNridentifier of orientation band
coarsestScalethe coarsest scale to compute the ratio for
finestScalethe finest scale to compute the ratio for

References stira::common::MathUtils::ComputeIntegerPower(), stira::imagedata::GridStatistics< T >::ComputeLocalAbsoluteMean(), stira::imagedata::Pyramid< T >::GetRecursiveScale(), stira::imagedata::Pyramid< T >::GetScaleFactorResidualLevel(), and stira::imagedata::Pyramid< T >::mNrScales.

template<class T >
T stira::imagedata::Pyramid< T >::GetAverageConeRatioSubSampled ( int  x,
int  y,
int  orientationNr,
int  coarsestScale,
int  finestScale 
)

computes the so-called Average Cone Ratio of pyramid coefficients in case the pyramid is subsampled

Ref: PhD thesis A. Pizurica "Image Denoising Using Wavelets and Spatial Context Modeling" p. 87 http://telin.ugent.be/~sanja/

Parameters
xx coordinate of the coefficient
yy coordinate of the coefficient
orientationNridentifier of orientation band
coarsestScalethe coarsest scale to compute the ratio for
finestScalethe finest scale to compute the ratio for

References stira::common::MathUtils::ComputeIntegerPower(), stira::imagedata::GridStatistics< T >::ComputeLocalAbsoluteMean(), stira::imagedata::Pyramid< T >::GetRecursiveScale(), stira::imagedata::Pyramid< T >::GetScaleFactorResidualLevel(), and stira::imagedata::Pyramid< T >::mNrScales.

template<class T >
PyramidLevel< T > * stira::imagedata::Pyramid< T >::GetRecursiveScale ( int  scale)
inline
template<class T >
void stira::imagedata::Pyramid< T >::SetLowpassResidual ( ArrayGrid< double > *  pGrid)
inline
template<class T >
void stira::imagedata::Pyramid< T >::SetScaleFactorRecursiveLevel ( double  factor)
inline

Gets the scale factor between two adjacent recursive levels Takes into account scaling of the energy content from level to level due to normalization of the coefficients.

Parameters
factorthe scaling factor

References stira::imagedata::Pyramid< T >::mScaleFactorRecursiveLevel.

template<class T >
void stira::imagedata::Pyramid< T >::SetScaleFactorResidualLevel ( double  factor)
inline

Sets the scale factor for the residual level Takes into account scaling of the energy content from level to level due to normalization of the coefficients.

Parameters
factorthe scaling factor

References stira::imagedata::Pyramid< T >::mScaleFactorResidualLevel.

template<class T >
void stira::imagedata::Pyramid< T >::SetScaleFactorResidualToRecursiveLevel ( double  factor)
inline

Sets the scale factor between the residual and the first recursive level Takes into account scaling of the energy content from level to level due to normalization of the coefficients.

Parameters
factorthe scaling factor

References stira::imagedata::Pyramid< T >::mScaleFactorResidualToRecursiveLevel.

template<class T>
ArrayGrid<T>* stira::imagedata::Pyramid< T >::UpSampleGrid ( ArrayGrid< T > *  pBandIn,
int  upSampledWidth,
int  upSampledHeight 
)
protected

Upsamples a band The caller gets a newly created band, and is responsible for deleting it after usage. Because of the ambiguity (both width 2n-1 and 2n were downsampled to new width n), the upsampled width and height need to be specified.

Parameters
pBandInthe band to be upsampled
upSampledWidthwidth of destination upsampled image
upSampledHeightheight of destination upsampled image

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