issue with coefficients of Discrete wavelet transform
1 回表示 (過去 30 日間)
古いコメントを表示
Please why am I getting 1 x 10517 as the result of coefficient exported to the workspace after using Discrete Wavelet Transform. The coefficient is too big to be used as feature vector or am I doing it wrongly? Someone please help me out
0 件のコメント
回答 (1 件)
Wayne King
2013 年 1 月 27 日
編集済み: Wayne King
2013 年 1 月 27 日
That is the entire vector of wavelet coefficients for the image down to the level you have specified. To create useful wavelet feature vectors you only use a subset of those coefficients.
If you are using the 2D DWT, then see wavedec2 for an explanation of which coefficients correspond to which subbands.
For example, let's say for your application, the diagonal detail coefficients at level 1 were deemed to be the most important and you also wanted the approximation coefficients at level 5.
load woman;
dwtmode('per','nodisplay')
% decomposition down to level 5
[C,S] = wavedec2(X,5,'bior3.5');
Consulting the help for wavedec2, we see that
app5 = C(1:prod(S(1,:)));
diag1 = C(end-prod(S(6,:))+1:end);
Give the coefficients you want to use.
Alternatively, and probably easier, is to use appcoef2 and detcoef2 to extract the desired coefficients at the desired level.
D1 = detcoef2('d',C,S,1);
A5 = appcoef2(C,S,'bior3.5',5);
The above are matrices, so if you want a vector, you can use reshape()
D1 = reshape(D1,prod(size(D1)),1);
A5 = reshape(A5,prod(size(A5)),1);
参考
カテゴリ
Help Center および File Exchange で Continuous Wavelet Transforms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!