write command for wavelet packet tree does not seem to work

조회 수: 1 (최근 30일)
UJJWAL
UJJWAL 2013년 8월 23일
Hi,
I am trying to create an empty wavelet packet tree and filling up its terminal nodes with coefficients. In short following is my simple code :-
clc,close all,clear all;
img = imread('barbara.png');
T = wpdec2(img,2,'db4');
T2 = cfs2wpt('db4',size(img),tnodes(T),4);
u = tnodes(T);
for i = 1:length(u)
x = read(T,'cfs',u(i));
write(T2,'cfs',u(i),x);
end
However when I display T2, i find that its terminal nodes contain no information except Zero matrics of appripriate sizes .. What is the reason and how do I correct this problem ?
  댓글 수: 1
UJJWAL
UJJWAL 2013년 8월 23일
I am facing this gruesome problem in the middle of an urgent work. So if someone can help out quickly, I would be grateful...

댓글을 달려면 로그인하십시오.

채택된 답변

UJJWAL
UJJWAL 2013년 8월 23일
I was able to solve this problem through debugging the internals of the write function. I found that the write function is recursive in nature.
The correction is the following :-
T2 = write(T2,'cfs',u(i),x);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 AI for Signals and Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by