STIRA
0.1
|
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... | |
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 More... | |
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) 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 | |
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)
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.
pSourceBand | input data |
myNrScales | nr of scales in pyramid |
myNrOrientations | nr of orientations |
isSubsampled | true if decomposition is subsampled to higher levels; false if representation is not subsampled |
needsResidualLevels | flag 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().
Pyramid< T > * stira::imagedata::Pyramid< T >::Clone | ( | ) |
writes all bands in all levels to PGM's
makes a deep copy of the current pyramid The caller is responsible for cleaning the returned object
References stira::imagedata::Pyramid< T >::CopyValuesFrom(), stira::imagedata::Pyramid< T >::mNrOrientations, stira::imagedata::Pyramid< T >::mNrScales, stira::imagedata::Pyramid< T >::mpResidualPyramidLevels, stira::imagedata::Pyramid< T >::mpSourceDataGrid, and stira::imagedata::Pyramid< T >::Pyramid().
void stira::imagedata::Pyramid< T >::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!!!
pOtherPyramid | the pyramid with the source data |
References stira::imagedata::ArrayGrid< T >::GetHeight(), stira::imagedata::Pyramid< T >::GetLowpassResidual(), stira::imagedata::Pyramid< T >::GetNumberOfOrientations(), stira::imagedata::Pyramid< T >::GetNumberOfScales(), stira::imagedata::PyramidLevel< T >::GetOrientedBand(), stira::imagedata::Pyramid< T >::GetRecursiveScale(), stira::imagedata::Pyramid< T >::GetResidualScale(), stira::imagedata::ArrayGrid< T >::GetValue(), stira::imagedata::ArrayGrid< T >::GetWidth(), stira::imagedata::Pyramid< T >::mpResidualPyramidLevels, and stira::imagedata::ArrayGrid< T >::SetValue().
Referenced by stira::imagedata::Pyramid< T >::Clone().
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
sourceWidth | width of data grid at full resolution |
sourceHeight | height of data grid at full resolution |
isSubsampled | flag if bands are subsampled or not |
isFinestScaleSubsampled | (for steerable pyramid) in case of subsampling indicates if first scale is subsampled or not |
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().
|
protected |
downsamples a given band The caller gets a newly created band, and is responsible for deleting it after usage
pBandIn | the band to be downsampled |
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/
x | x coordinate of the coefficient |
y | y coordinate of the coefficient |
orientationNr | identifier of orientation band |
coarsestScale | the coarsest scale to compute the ratio for |
finestScale | the 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.
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/
x | x coordinate of the coefficient |
y | y coordinate of the coefficient |
orientationNr | identifier of orientation band |
coarsestScale | the coarsest scale to compute the ratio for |
finestScale | the 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.
|
inline |
Gets a list of oriented subbands belonging to a recursive scale of the pyramid.
scale | number of scale to get |
References stira::imagedata::Pyramid< T >::GetNumberOfScales(), and stira::imagedata::Pyramid< T >::mvpRecursivePyramidLevels.
Referenced by stira::imagedata::Pyramid< T >::CopyValuesFrom(), stira::steerable::PyramidBurtAdelson::Decompose(), stira::wavelet::CriticallySubsampledTransform::Decompose(), stira::steerable::PyramidComplex::Decompose(), stira::steerable::PyramidReal::Decompose(), stira::steerable::PyramidReal::Diagnose(), stira::steerable::PyramidComplex::Diagnose(), stira::imagedata::Pyramid< T >::GetAverageConeRatioRedundant(), stira::imagedata::Pyramid< T >::GetAverageConeRatioSubSampled(), stira::steerable::PyramidBurtAdelson::GetPyramid(), stira::wavelet::CriticallySubsampledTransform::Reconstruct(), stira::wavelet::NonSubsampledTransform::Reconstruct(), stira::steerable::PyramidComplex::Reconstruct(), stira::steerable::PyramidReal::Reconstruct(), stira::wavelet::NoiseEstimator::Run(), stira::deconvolve::GNCDeconvolve::Run(), stira::pyramidapplications::PyramidContrastEnhancer::Run3Colors(), stira::pyramidapplications::PyramidContrastEnhancer::RunPyramid(), stira::imagetools::PyramidTools::VisualizeRealPyramid(), and stira::imagetools::PyramidTools::~PyramidTools().
|
inline |
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
pGrid | input grid |
References stira::imagedata::Pyramid< T >::mpLowPassResidual.
Referenced by stira::steerable::PyramidBurtAdelson::Decompose(), stira::wavelet::CriticallySubsampledTransform::Decompose(), stira::steerable::PyramidComplex::Decompose(), stira::steerable::PyramidReal::Decompose(), stira::wavelet::NonSubsampledTransform::Reconstruct(), stira::steerable::PyramidComplex::Reconstruct(), and stira::steerable::PyramidReal::Reconstruct().
|
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.
factor | the scaling factor |
References stira::imagedata::Pyramid< T >::mScaleFactorRecursiveLevel.
|
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.
factor | the scaling factor |
References stira::imagedata::Pyramid< T >::mScaleFactorResidualLevel.
|
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.
factor | the scaling factor |
References stira::imagedata::Pyramid< T >::mScaleFactorResidualToRecursiveLevel.
|
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.
pBandIn | the band to be upsampled |
upSampledWidth | width of destination upsampled image |
upSampledHeight | height of destination upsampled image |