Multi level decomposition of image for image compression using ANN

1 view (last 30 days)
I am working on image compression using ANN. I have splitted the image into 16 parts and each part is given as input to ANN for image compression. My approach is
a=imread('image.png');
x=imresize(a,[64 64]);
xn=mat2gray(x);
[r c]=size(xn);
x1=xn(1:r/4,1:c/4);
x2=xn(1:r/4,c/4+1:c/2);
x3=xn(1:r/4,c/2+1:(3/4)*c);
x4=xn(1:r/4,(3/4)*c+1:c);
x5=xn(r/4+1:r/2,1:c/4);
x6=xn((r/4)+1:r/2,c/4+1:(1/2)*c);
x7=xn(r/4+1:r/2,(1/2)*c+1:(3/4)*c);
x8=xn(r/4+1:r/2,(3/4)*c+1:c);
x9=xn(r/2+1:3/4*r,1:c/4);
x10=xn(r/2+1:3/4*r,c/4+1:(1/2)*c);
x11=xn(r/2+1:3/4*r,(1/2)*c+1:(3/4)*c);
x12=xn(r/2+1:3/4*r,(3/4)*c+1:c);
x13=xn(3*r/4+1:r,1:c/4);
x14=xn(3*r/4+1:r,c/4+1:c/2);
x15=xn(3*r/4+1:r,c/2+1:(3/4)*c);
x16=xn(3*r/4+1:r,(3/4)*c+1:c);
Then I created two ANN s for each subimage for compression and decompression of the image using the command feedforwardnet. But I found the following errors.I have done 4-level and 9-level decomposition image compression using the same method and it worked. How to overcome the errors? ??? Error using ==> trainlm at 109 Input data size does not match net.inputs{1}.size.
Error in ==> network.train at 107 [net,tr] = feval(net.trainFcn,net,X,T,Xi,Ai,EW,net.trainParam);
Error in ==> test_21_11 at 136 net_s5d=train(net_s5d,pds5,tds5,0,1,0.001);

Answers (0)

Categories

Find more on Denoising and Compression in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!