C# Class CSJ2K.j2k.wavelet.analysis.SubbandAn

This class represents a subband in a bidirectional tree structure that describes the subband decomposition for a wavelet transform, specifically for the analysis side.

The element can be either a node or a leaf of the tree. If it is a node then ther are 4 descendants (LL, HL, LH and HH). If it is a leaf there are no descendants.

The tree is bidirectional. Each element in the tree structure has a "parent", which is the subband from which the element was obtained by decomposition. The only exception is the root element which has no parent (i.e.it's null), for obvious reasons.

Inheritance: CSJ2K.j2k.wavelet.Subband
Exibir arquivo Open project: cureos/csj2k Class Usage Examples

Public Properties

Property Type Description
hFilter CSJ2K.j2k.wavelet.analysis.AnWTFilter
l2Norm float
parentband SubbandAn
stepWMSE float
subb_HH SubbandAn
subb_HL SubbandAn
subb_LH SubbandAn
subb_LL SubbandAn
vFilter CSJ2K.j2k.wavelet.analysis.AnWTFilter

Public Methods

Method Description
SubbandAn ( ) : System

Creates a SubbandAn element with all the default values. The dimensions are (0,0) and the upper left corner is (0,0).

SubbandAn ( int w, int h, int ulcx, int ulcy, int lvls, WaveletFilter hfilters, WaveletFilter vfilters ) : System

Creates the top-level node and the entire subband tree, with the top-level dimensions, the number of decompositions, and the decomposition tree as specified.

This constructor just calls the same constructor of the super class, and then calculates the L2-norm (or energy weight) of each leaf.

This constructor does not initialize the value of the magBits or stepWMSE member variables. This variables are normally initialized by the quantizer (see Quantizer).

Protected Methods

Method Description
split ( WaveletFilter hfilter, WaveletFilter vfilter ) : Subband

Splits the current subband in its four subbands. It changes the status of this element (from a leaf to a node, and sets the filters), creates the childs and initializes them. An IllegalArgumentException is thrown if this subband is not a leaf.

It uses the initChilds() method to initialize the childs.

Private Methods

Method Description
assignL2Norm ( float l2n ) : void

Assigns the given L2-norm to the first leaf that does not have an L2-norm value yet (i.e. l2norm is negative). The search is done recursively and in the same order as that of the calcBasisWaveForms() method, so that this method is used to assigne the l2norm of the previously computed waveforms.

This method can not be called on an element that ahs a non-negative value in l2Norm, since that means that we are done.

calcBasisWaveForms ( float wfs ) : void

Calculates the basis waveform of the first leaf for which the L2-norm has not been calculated yet. This method searches recursively for the first leaf for which the value has not been calculated yet, and then calculates the L2-norm on the return path.

The wfs argument should be a size 2 array of float arrays (i.e. 2D array) and it must be of length 2 (or more). When returning, wfs[0] will contain the line waveform, and wfs[1] will contain the column waveform.

This method can not be called on an element that ahs a non-negative value in l2Norm, since that means that we are done.

calcL2Norms ( ) : void

Calculates the L2-norm of the sythesis waveforms of every leaf in the tree. This method should only be called on the root element.

Method Details

SubbandAn() public method

Creates a SubbandAn element with all the default values. The dimensions are (0,0) and the upper left corner is (0,0).
public SubbandAn ( ) : System
return System

SubbandAn() public method

Creates the top-level node and the entire subband tree, with the top-level dimensions, the number of decompositions, and the decomposition tree as specified.

This constructor just calls the same constructor of the super class, and then calculates the L2-norm (or energy weight) of each leaf.

This constructor does not initialize the value of the magBits or stepWMSE member variables. This variables are normally initialized by the quantizer (see Quantizer).

public SubbandAn ( int w, int h, int ulcx, int ulcy, int lvls, WaveletFilter hfilters, WaveletFilter vfilters ) : System
w int The top-level width /// ///
h int The top-level height /// ///
ulcx int The horizontal coordinate of the upper-left corner with /// respect to the canvas origin, in the component grid. /// ///
ulcy int The vertical coordinate of the upper-left corner with /// respect to the canvas origin, in the component grid. /// ///
lvls int The number of levels (or LL decompositions) in the tree. /// ///
hfilters WaveletFilter The horizontal wavelet analysis filters for each /// resolution level, starting at resolution level 0. /// ///
vfilters WaveletFilter The vertical wavelet analysis filters for each /// resolution level, starting at resolution level 0. /// ///
return System

split() protected method

Splits the current subband in its four subbands. It changes the status of this element (from a leaf to a node, and sets the filters), creates the childs and initializes them. An IllegalArgumentException is thrown if this subband is not a leaf.

It uses the initChilds() method to initialize the childs.

protected split ( WaveletFilter hfilter, WaveletFilter vfilter ) : Subband
hfilter WaveletFilter The horizontal wavelet filter used to decompose this /// subband. It has to be a AnWTFilter object. /// ///
vfilter WaveletFilter The vertical wavelet filter used to decompose this /// subband. It has to be a AnWTFilter object. /// ///
return CSJ2K.j2k.wavelet.Subband

Property Details

hFilter public_oe property

The horizontal analysis filter used to decompose this subband. This is applicable to "node" elements only. The default value is null.
public AnWTFilter,CSJ2K.j2k.wavelet.analysis hFilter
return CSJ2K.j2k.wavelet.analysis.AnWTFilter

l2Norm public_oe property

The L2-norm of the synthesis basis waveform of this subband, applicable to "leafs" only. By default it is -1 (i.e. not calculated yet).
public float l2Norm
return float

parentband public_oe property

The reference to the parent of this subband. It is null for the root element. It is null by default.
public SubbandAn,CSJ2K.j2k.wavelet.analysis parentband
return SubbandAn

stepWMSE public_oe property

The contribution to the MSE or WMSE error that would result in the image if there was an error of exactly one quantization step size in the sample of the subband. This value is expressed relative to a nominal dynamic range in the image domain of exactly 1.0. This field contains valid data only after quantization 9See Quantizer).
public float stepWMSE
return float

subb_HH public_oe property

The reference to the HH subband resulting from the decomposition of this subband. It is null by default.
public SubbandAn,CSJ2K.j2k.wavelet.analysis subb_HH
return SubbandAn

subb_HL public_oe property

The reference to the HL subband (horizontal high-pass) resulting from the decomposition of this subband. It is null by default.
public SubbandAn,CSJ2K.j2k.wavelet.analysis subb_HL
return SubbandAn

subb_LH public_oe property

The reference to the LH subband (vertical high-pass) resulting from the decomposition of this subband. It is null by default.
public SubbandAn,CSJ2K.j2k.wavelet.analysis subb_LH
return SubbandAn

subb_LL public_oe property

The reference to the LL subband resulting from the decomposition of this subband. It is null by default.
public SubbandAn,CSJ2K.j2k.wavelet.analysis subb_LL
return SubbandAn

vFilter public_oe property

The vertical analysis filter used to decompose this subband. This is applicable to "node" elements only. The default value is null.
public AnWTFilter,CSJ2K.j2k.wavelet.analysis vFilter
return CSJ2K.j2k.wavelet.analysis.AnWTFilter