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!