Extract 2-D detail coefficients.
Syntax
D = detcoef2(O,C,S,N)
Description
detcoef2 is a two-dimensional wavelet analysis function.
D = detcoef2(O,C,S,N) extracts from the wavelet decomposition structure [C,S] (see wavedec2), the horizontal, vertical, or diagonal detail coefficients for O = 'h'(or 'v' or 'd', respectively), at level N.
Level N must be an integer such that 1 <= N <= size(S,1)-2.
Examples
% 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');
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
% Extract details coefficients at level 2
% in each orientation, from wavelet decomposition
% structure [c,s].
chd2 = detcoef2('h',c,s,2);
cvd2 = detcoef2('v',c,s,2);
cdd2 = detcoef2('d',c,s,2);
sizecd2 = size(chd2)
sizecd2 =
64 64
% Extract details coefficients at level 1
% in each orientation, from wavelet decomposition
% structure [c,s].
chd1 = detcoef2('h',c,s,1);
cvd1 = detcoef2('v',c,s,1);
cdd1 = detcoef2('d',c,s,1);
sizecd1 = size(chd1)
sizecd1 =
128 128
See Also
appcoef2, wavedec2
[ Previous | Help Desk | Next ]