comparison util/Pierre_reconstruct.m @ 127:6f78b069e541

Merge from branch "ivand_dev" after issues 158, 159, 163 resolved
author Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk>
date Wed, 25 May 2011 15:34:37 +0100
parents 002ec1b2ceff
children
comparison
equal deleted inserted replaced
109:9793ce00d729 127:6f78b069e541
1 function reconstructed=Pierre_reconstruct(y, Problem) 1 function reconstructed=Pierre_reconstruct(y, Problem)
2 %%% Pierre Villars Example - reconstruction function 2 %% Pierre Villars Example - reconstruction function
3 %
4 % using sparse representation y in dictionary Problem.A reconstruct the
5 % patches from the target image
6 % This example is based on the experiment suggested by Professor Pierre
7 % Vandergheynst on the SMALL meeting in Villars.
8
3 % 9 %
4 % Centre for Digital Music, Queen Mary, University of London. 10 % Centre for Digital Music, Queen Mary, University of London.
5 % This file copyright 2009 Ivan Damnjanovic. 11 % This file copyright 2009 Ivan Damnjanovic.
6 % 12 %
7 % This program is free software; you can redistribute it and/or 13 % This program is free software; you can redistribute it and/or
8 % modify it under the terms of the GNU General Public License as 14 % modify it under the terms of the GNU General Public License as
9 % published by the Free Software Foundation; either version 2 of the 15 % published by the Free Software Foundation; either version 2 of the
10 % License, or (at your option) any later version. See the file 16 % License, or (at your option) any later version. See the file
11 % COPYING included with this distribution for more information. 17 % COPYING included with this distribution for more information.
12 % 18 %
13 % This example is based on the experiment suggested by Professor Pierre 19 %%
14 % Vandergheynst on the SMALL meeting in Villars.
15
16 % using sparse representation y in dictionary Problem.A reconstruct the
17 % patches from the target image
18
19 imout=Problem.A*y; 20 imout=Problem.A*y;
20 21
21 % combine the patches into reconstructed image 22 % combine the patches into reconstructed image
22 23
23 im=col2im(imout,Problem.blocksize,size(Problem.imageTrg),'disctint'); 24 im=col2imstep(imout,size(Problem.imageTrg),Problem.blocksize,Problem.blocksize);
24 25
25 % bound the pixel values to [0,255] range 26 % bound the pixel values to [0,255] range
26 im(im<0)=0; 27 im(im<0)=0;
27 im(im>255)=255; 28 im(im>255)=255;
28 29