Undefined function 'wprec2' for input arguments of type 'double'.

1 次查看(过去 30 天)
I applied wpdec2 (Wavelet Packet transform) on a color image with size 512 * 512. It generates a subtree then I applied wpcoef to get it coefficients. On these coefficients I created blocks and apply DCT and inverse of DCT and blocks. Then i applied wprec2 after reverse process of block. Then i got a error as given below:
Undefined function 'wprec2' for input arguments of type 'double'.
Please help to troubleshoot this problem.

采纳的回答

dpb
dpb 2021-8-22
Without the actual code sequence we can't tell but the doc for wprec2 says it expects a wavelet packet tree object.
If you've munged on the output of wpdec2 to produce some output array of double, then you've broken the contract between the two of the forward/reverse transform.
All wprec2 promises is that it will reproduce X from the output of wdec2 operating on X
  1 个评论
Balkar Singh
Balkar Singh 2021-8-24
clear all;
img = imread('Image9.png');
T = wpdec2(img,6,'db5');
Tree_cfs = read(T,'allcfs');
X = wpcoef(T);
blksize=[8,8];
blk1 = our_blkproc(X,blksize);
dct_data = zeros(8,8,size(blk1,3));
for i=1:size(blk1,3)
dct_data(:,:,i) = dct2(blk1(:,:,i));
end
dct_data_inv = zeros(8,8,size(blk1,3));
for i=1:size(blk1,3)
dct_data_inv(:,:,i) = idct2(dct_data(:,:,i));
end
final_data = our_blkproc_rev(dct_data_inv);
final_data = reshape(final_data,1,[]);
x1 = wprec2(final_data);
I tried this code

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Signal Analysis 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by