Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MATLAB help required for Image Processing!

Status
Not open for further replies.

UFK

Member level 3
Joined
Mar 8, 2010
Messages
60
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Pakistan
Activity points
1,728
hi all

im trying to perform a 4-level Inverse discrete wavelet transform by using the MATLAB command idwt2, on a 16x16 matrix. Please help me with it. Thanks alot in advance
 

send me urs complete project title to me then i will send the codes what ever i have on wavelets and reconstructions process
 

Hello

Thanks for the response. Im working on the SPIHT Image Compression Algorithm. Iv calculated the DWT of a sample image on MATLAB, then designed the encoder and decoder on Verilog HDL. The decoded output is a 16X16 matrix on which i want to perform the Invserse DWT so i can recover the original image.

My IDWT code is as follows:

ch1=zeros(8,8)

cd1=zeros(8,8)

cv1=[0 0 0 0 0 0 0 0;
0 0 192 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0]

ca1=[2624 -192 0 320 0 0 0 192;
576 0 0 -320 0 0 0 0;
448 -192 0 -192 0 0 0 0;
0 -192 0 192 0 0 0 0;
0 0 0 -192 0 0 0 0;
0 0 0 0 0 -192 0 0;
0 0 0 0 0 0 192 0;
0 0 0 0 0 0 0 0]


F=zeros(16,16)

F(1:8,9:16)=round(ch1);

F(9:16,1:8)=round(cv1);

F(9:16,9:16)=round(cd1);

F(1:8, 1:8 )=round(ca1);

A0 = idwt2(ca1,ch1,cv1,cd1,'db1',F);


ca2= [1312 1312 -96 -96 0 0 160 160;
1312 1312 -96 -96 0 0 160 160;
288 288 0 0 96 -96 -160 -160;
288 288 0 0 96 -96 -160 -160;
224 224 -96 -96 0 0 -96 -96;
224 224 -96 -96 0 0 -96 -96;
0 0 -96 -96 0 0 96 96;
0 0 -96 -96 0 0 96 96]

cv2= [0 0 0 0 0 0 -96 -96;
0 0 0 0 0 0 -96 -96;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0]

ch2= [ 0 0 0 0 0 0 96 96;
0 0 0 0 0 0 96 96;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0]


cd2= [ 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 -96 -96 0 0 0 0;
0 0 -96 -96 0 0 0 0;
0 0 0 0 96 96 0 0;
0 0 0 0 96 96 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0]



G=zeros(16,16)

G(1:8,9:16)=round(ch2);

G(9:16,1:8)=round(cv2);

G(9:16,9:16)=round(cd2);

G(1:8, 1:8 )=round(ca2);

A1 = idwt2(ca2,ch2,cv2,cd2,'db1',G);

ca3= [656 656 656 656 -48 -48 -48 -48;
656 656 656 656 -48 -48 -48 -48;
656 656 656 656 -48 -48 -48 -48;
656 656 656 656 -48 -48 -48 -48;
144 144 144 144 -48 48 -48 48;
144 144 144 144 48 -48 48 -48;
144 144 144 144 -48 48 -48 48;
144 144 144 144 48 -48 48 -48]




ch3= [ 0 0 0 0 80 176 80 176;
0 0 0 0 -16 80 -16 80;
0 0 0 0 80 176 80 176;
0 0 0 0 -16 80 -16 80;
48 48 -48 -48 -80 -80 -80 -80;
48 48 -48 -48 -80 -80 -80 -80;
48 48 -48 -48 -80 -80 -80 -80;
48 48 -48 -48 -80 -80 -80 -80]


cd3= [48 -48 48 -48 -48 -48 -48 -48;
-48 48 -48 48 -48 -48 -48 -48;
48 -48 48 -48 -48 -48 -48 -48;
-48 48 -48 48 -48 -48 -48 -48;
0 0 0 0 48 48 48 48;
0 0 0 0 48 48 48 48;
0 0 0 0 48 48 48 48;
0 0 0 0 48 48 48 48]


cv3= [112 112 112 112 -48 -48 -48 -48;
112 112 112 112 -48 -48 -48 -48;
112 112 112 112 -48 -48 -48 -48;
112 112 112 112 -48 -48 -48 -48;
0 0 0 0 -48 -48 -48 -48;
0 0 0 0 -48 -48 -48 -48;
0 0 0 0 -48 -48 -48 -48;
0 0 0 0 -48 -48 -48 -48]

H=zeros(16,16)

H(1:8,9:16)=round(ch3);

H(9:16,1:8)=round(cv3);

H(9:16,9:16)=round(cd3);

H(1:8, 1:8 )=round(ca3);

A2 = idwt2(ca3,ch3,cv3,cd3,'db1',H);
A2=round(A2)


ca4= [408 248 360 296 408 248 360 296;
360 296 408 248 360 296 408 248;
360 296 408 248 360 296 408 248;
408 248 360 296 408 248 360 296;
408 248 360 296 408 248 360 296;
360 296 408 248 360 296 408 248;
360 296 408 248 360 296 408 248;
408 248 360 296 408 248 360 296]

ch4= [-32 64 16 112 -32 64 16 112;
-64 -64 -112 -112 -64 -64 -112 -112;
-80 16 -32 64 -80 16 -32 64;
-16 -16 -64 -64 -16 -16 -64 -64;
-32 64 16 112 -32 64 16 112;
-64 -64 -112 -112 -64 -64 -112 -112;
-80 16 -32 64 -80 16 -32 64;
-16 -16 -64 -64 -16 -16 -64 -64]

cv4= [ 96 96 96 96 48 48 48 48;
48 48 48 48 96 96 96 96;
96 96 96 96 48 48 48 48;
48 48 48 48 96 96 96 96;
96 96 96 96 48 48 48 48;
48 48 48 48 96 96 96 96;
96 96 96 96 48 48 48 48;
48 48 48 48 96 96 96 96]


cd4= [-64 -64 -16 -16 -64 -64 -16 -16;
-32 64 16 112 -32 64 16 112;
-16 -16 -64 -64 -16 -16 -64 -64;
16 112 -32 64 16 112 -32 64;
-64 -64 -16 -16 -64 -64 -16 -16;
-32 64 16 112 -32 64 16 112;
-16 -16 -64 -64 -16 -16 -64 -64;
16 112 -32 64 16 112 -32 64]


I=zeros(16,16)

I(1:8,9:16)=round(ch4);

I(9:16,1:8)=round(cv4);

I(9:16,9:16)=round(cd4);

I(1:8, 1:8 )=round(ca4);

A3 = idwt2(ca4,ch4,cv4,cd4,'db1',I);
A3 =round(A3)

As u can see, iv assigned values to ca,cv and cd individually at each level. Im not too sure but i think thats now how its done.
Please see if you can help me with it. Thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top