Sign in

username:

password:



Not a member?

Search imagedsp



Search tips

Subscribe to imagedsp



imagedsp by Keywords

Error Concealment | JPEG | MPEG-4 | Wavelet | YUV

Sponsor

Evaluate multicore with Texas Instruments:
Low-cost evaluation module & free software development kit available NOW.

Discussion Groups

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Image Signal Processing | Wavelet interpolation

Technical Discussions related to Image Processing (image coding, compression, digital effects, mpeg, etc)

  

Post a new Thread

Wavelet interpolation - snehamoyc - Mar 10 20:54:20 2009

Hi,
I am working on image interpolation using wavelet transformation. I am doing one
level wavelet transformation of my data and interpolating all 4 sub bands and
inverse transformation to get interpolated image in spatial domain. I am trying
with lena image but didn't get any satisfactory result. Here is my matlab code.
Can anybody help me out what wrong I am doing with this program?

load lena;
X=lena;
X=imresize(X, [128,128]);
y1=X(1:2:end,1:2:end); %% This is the image  to be interpolated

[W,S]=wavedec2(y1,1,'haar');

 a=W(1:S(1,1)*S(1,2));
 d1=W(S(1,1)*S(1,2+1:2*S(1,1)*S(1,2)));
 d2=W(2*S(1,1)*S(1,2)+1:3*S(1,1)*S(1,2));
 d3=W(3*S(1,1)*S(1,2)+1:end);

[Xi,Yi] = meshgrid(1:1:32);
[Xj,Yj] = meshgrid(0.5:0.5:32);
VI_Hd3 = interp2(Xi,Yi,d3,Xj,Yj,'linear');
VI_Hd1 = interp2(Xi,Yi,d1,Xj,Yj,'linear');
VI_Hd2 = interp2(Xi,Yi,d2,Xj,Yj,'linear');
VI_Ha1 = interp2(Xi,Yi,a,Xj,Yj,'linear');

y=[reshape(VI_Ha1, numel(VI_Ha1),1);reshape(VI_Hd1,
numel(VI_Hd1),1);reshape(VI_Hd2, numel(VI_Hd2),1);reshape(VI_Hd3,
numel(VI_Hd3),1)];
S1=2*S;
Xhat = waverec2(y, S1, 'haar');
imagesc(Xhat);
figure (2); hist(reshape(Xhat, numel(Xhat),1));

Waiting for help.

With regards,

Snehamoy

______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of imagedsp -- send a blank email to imagedsp-subscribe@yahoogroups.com )

Re: Wavelet interpolation - Chatonda Mtika - Mar 11 10:13:39 2009

perhaps it would help if you explained what you meant by "not getting
satisfactory results".

my guess is you are trying to show perfect reconstruction. here's the 
best way to start: pick a sequence x = [1 2 3 4 5 6 7 8 9], and see if
you can get perfect reconstruction. what you will notice is that there will
be a cyclic shift in the samples. once you correct that, you shouldn't
have any problems extending it to the 2-d separable filtering case that
you're trying to perform.

- chatonda

________________________________
From: snehamoyc <s...@gmail.com>
To: i...@yahoogroups.com
Sent: Tuesday, March 10, 2009 5:19:28 PM
Subject: [imagedsp] Wavelet interpolation
Hi,
I am working on image interpolation using wavelet transformation. I am doing one
level wavelet transformation of my data and interpolating all 4 sub bands and
inverse transformation to get interpolated image in spatial domain. I am trying
with lena image but didn't get any satisfactory result. Here is my matlab code.
Can anybody help me out what wrong I am doing with this program?

load lena;
X=lena;
X=imresize(X, [128,128]);
y1=X(1:2:end, 1:2:end); %% This is the image  to be interpolated

[W,S]=wavedec2( y1,1,'haar' );

a=W(1:S(1,1) *S(1,2));
d1=W(S(1,1)* S(1,2+1:2* S(1,1)*S( 1,2)));
d2=W(2*S(1,1) *S(1,2)+1: 3*S(1,1)* S(1,2));
d3=W(3*S(1,1) *S(1,2)+1: end);
[Xi,Yi] = meshgrid(1:1: 32);
[Xj,Yj] = meshgrid(0.5: 0.5:32);

VI_Hd3 = interp2(Xi,Yi, d3,Xj,Yj, 'linear') ;
VI_Hd1 = interp2(Xi,Yi, d1,Xj,Yj, 'linear') ;
VI_Hd2 = interp2(Xi,Yi, d2,Xj,Yj, 'linear') ;
VI_Ha1 = interp2(Xi,Yi, a,Xj,Yj,' linear');

y=[reshape(VI_ Ha1, numel(VI_Ha1) ,1);reshape( VI_Hd1, numel(VI_Hd1)
,1);reshape( VI_Hd2, numel(VI_Hd2) ,1);reshape( VI_Hd3, numel(VI_Hd3) ,1)];
S1=2*S;
Xhat = waverec2(y, S1, 'haar');
imagesc(Xhat) ;
figure (2); hist(reshape( Xhat, numel(Xhat), 1));

Waiting for help.

With regards,

Snehamoy

______________________________
StarterWare provides C-based no-OS platform support for the C6000 DSP devices.
Click here for details.




(You need to be a member of imagedsp -- send a blank email to imagedsp-subscribe@yahoogroups.com )