-
Notifications
You must be signed in to change notification settings - Fork 0
/
wavelet_dec.m
38 lines (30 loc) · 1003 Bytes
/
wavelet_dec.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
% ------------------------------------------------------------------------------
%
% Author: Helder C. R. Oliveira
%
% Copyright (c) Helder Oliveira, 2015
% Email: [email protected]
%
% ------------------------------------------------------------------------------
function [cA, cH, cV, cD, tams] = wavelet_dec(img, levels, wavename)
% Approximation
cA = cell(1, levels);
% Horizontal
cH = cell(1, levels);
% Vertical
cV = cell(1, levels);
% Diagonal
cD = cell(1, levels);
image_ini = img;
% Guardando as Dimensoes
tams = size(img);
% Aplly the decompositions extracting the coefficients
for level = 1:levels,
% Nao-decimada (estacionaria)
[cA{level}, cH{level}, cV{level}, cD{level}] = swt2(image_ini, 1, wavename);
% Decimada
%[cA{level}, cH{level}, cV{level}, cD{level}] = idwt2(image_ini, wavename);
tams = [tams; size(cH{level})];
image_ini = cA{level};
end
end