Talk about the WAVEDEC2 function.

Source: Internet
Author: User

Http://maiqiuzhizhu.blog.sohu.com/110325150.html

WAVEDEC2 function:

1. Function: realize multi-layer decomposition of image (i.e., two-dimensional signal).

Multilayer, that is, multi-scale.

2. Format: [C,s]=wavedec2 (X,n, ' wname ')

[C,s]=wavedec2 (X,n,lo_d,hi_d) (I don't discuss it)

3. Parameter description: N-layer decomposition using wname wavelet function for image x

Here the wavelet function should be selected according to the actual situation, the specific choice method can be searched. The output is c,s.

c is the decomposition coefficient of each layer, s is the decomposition coefficient length of each layer, that is, size.

Structure of 4.c: C=[a (N) | H (N) | V (N) | D (N) | H (N-1) | V (N-1) | D (N-1) | H (N-2) | V (N-2) | D (N-2) |...| H (1) | V (1) | D (1)]

Visible, C is a line vector, that is: 1* (Size (X)), (e.g,x=256*256,then C size: 1* (256*256) =1*65536)

A (n) represents the nth-layer low-frequency coefficient, H (n) | V (N) | D (n) represents the nth layer high frequency coefficients, respectively horizontal, vertical, diagonal high frequency, and so on, to H (1) | V (1) | D (1).

S structure: is the storage of the decomposition coefficient length of each layer, that is, the first line is a (n) length, the second line is H (n) | V (N) | D (N) | The length of the third line is

H (N-1) | V (N-1) | D (N-1) length, the penultimate line is H (1) | V (1) | D (1) length, the last line is the length of x (size)


So what's the use of s?

s structure: is the storage of the decomposition coefficient length of each layer, that is, the first line is a (n) length (in fact, a (n) of the original matrix of the number of rows and columns),

the second line is H (N) | V (N) | The length of D (N) |,

the third line is

H (N-1) | V (N-1) | The length of D (N-1),

the penultimate line is H (1) | V (1) | D (1) Length,

the last line is the length of x (size)



from the above figure can know: the length of Can is 32*32,ch1, cV1, cD1 length is 256*256.

so far, you might want to ask why the output of C is a line vector?

1, not that a language can dynamically output the number of parameters, not to mention the C language written matlab

2. The size of the detailed coefficient matrix at all levels (size) is not the same, so it cannot be combined into a large matrix output.

Therefore, it is the best and the only choice to output the result as a row vector.

Another: MATLAB help inside said very clearly, hehe.

Wavedec2

Multilevel 2-d wavelet decomposition Syntax [c,s] = WAVEDEC2 (x,n, ' wname ')


[C,s] = WAVEDEC2 (x,n,lo_d,hi_d)


Description WAVEDEC2 is a two-dimensional wavelet analysis function.

[C,s] = WAVEDEC2 (x,n, ' wname ') returns the wavelet decomposition of the matrix X at level N, using the wavelet named in Str ing ' wname ' (see wfilters for more information).

Outputs is the decomposition vector C and the corresponding bookkeeping matrix S. N must be a strictly positive integer ( See Wmaxlev for more information).

Instead of giving the wavelet name, you can give the filters. for [c,s] = WAVEDEC2 (x,n,lo_d,hi_d), Lo_d is the decomposition Low-pass filter and hi_d are the Decomposition High-pass fil ter.

Vector C is organized as C = [A (N) | H (N) | V (N) | D (N) | ... H (N-1) | V (N-1) | D (N-1) | ... | H (1) | V (1) | D (1)]. Where a, H, V, D, is row vectors such that a = approximation coefficients H = horizontal detail coefficients V = Vertical Detail coefficients D = diagonal detail coefficients each vector is the vector column-wise storage of a matrix.

Matrix S is such this s (1,:) = size of approximation coefficients (N) S (i,:) = size of detail coefficients (n-i+2) for i = 2 , ... N+1 and S (n+2,:) = Size (X)

examples% the current extension mode was zero-padding (see Dwtmode).

% Load Original image.
Load woman;
% X contains the loaded image.

% Perform decomposition at level 2
% of X using DB1.
[C,s] = WAVEDEC2 (x,2, ' db1 ');

% decomposition structure organization.
Sizex = Size (X)

Sizex =
256 256
Sizec = Size (c)

Sizec =
1 65536
val_s = S

val_s =
64 64
64 64
128 128
256 256


Algorithm for images, a algorithm similar to the one-dimensional case was possible for two-dimensional wavelets and Scali ng functions obtained from one-dimensional ones by tensor product. This kind of two-dimensional DWT leads-a decomposition of approximation coefficients at level J-four Components:the Approximation at level j+1, and the details in three orientations (horizontal, vertical, and diagonal). The following chart describes the basic decomposition step for images:  so, for j=2, the two-dimensional wavelet tree Have the form  see ALSODWT, Waveinfo, WAVEREC2, Wfilters, Wmaxlev Referencesdaubechies, I. (1992), Ten Lectures on WA Velets, CBMS-NSF conference series in Applied Mathematics. SIAM Ed Mallat, S. (1989), "A Theory for multiresolution signal decomposition:the wavelet representation," IEEE Pattern Anal. and Machine Intell., vol. one, No. 7, pp. 674-693. Meyer, Y. (1990), ondelettes et opérateurs, Tome 1, Hermann Ed. (中文版 translation:wavelets and OperAtors, Cambridge Univ Press. 1993.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.