comparison util/SMALL_ImgDeNoiseResult.m @ 126:db5a7fe1a404 ivand_dev

Merge from branch "sup_158_IMG_Processing_toolbox_"
author Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk>
date Wed, 25 May 2011 15:30:34 +0100
parents 002ec1b2ceff
children
comparison
equal deleted inserted replaced
121:5ded5e2e7d07 126:db5a7fe1a404
1 function SMALL_ImgDeNoiseResult(SMALL) 1 function SMALL_ImgDeNoiseResult(SMALL)
2 %% Represents the results of Dictionary Learning for Image denoising
2 % 3 %
4 % Function gets as input SMALL structure and plots Image Denoise
5 % results: Original Image, Noisy Image and for learned dictionaries and
6 % denoised images
7 %
8
3 % Centre for Digital Music, Queen Mary, University of London. 9 % Centre for Digital Music, Queen Mary, University of London.
4 % This file copyright 2010 Ivan Damnjanovic. 10 % This file copyright 2010 Ivan Damnjanovic.
5 % 11 %
6 % This program is free software; you can redistribute it and/or 12 % This program is free software; you can redistribute it and/or
7 % modify it under the terms of the GNU General Public License as 13 % modify it under the terms of the GNU General Public License as
8 % published by the Free Software Foundation; either version 2 of the 14 % published by the Free Software Foundation; either version 2 of the
9 % License, or (at your option) any later version. See the file 15 % License, or (at your option) any later version. See the file
10 % COPYING included with this distribution for more information. 16 % COPYING included with this distribution for more information.
11 % 17 %%
12 % Function gets as input SMALL structure and plots Image Denoise
13 % results: Original Image, Noisy Image and for learned dictionaries and
14 % denoised images
15 18
16 19
17 figure('Name', sprintf('Image %s (training set size- %d, sigma - %d)',SMALL.Problem.name, SMALL.Problem.n, SMALL.Problem.sigma)); 20 figure('Name', sprintf('Image %s (training set size- %d, sigma - %d)',SMALL.Problem.name, SMALL.Problem.n, SMALL.Problem.sigma));
18 21
19 m=size(SMALL.solver,2)+1; 22 m=size(SMALL.solver,2)+1;
35 if strcmpi(SMALL.DL(i-1).name,'ksvds') 38 if strcmpi(SMALL.DL(i-1).name,'ksvds')
36 D = kron(SMALL.Problem.basedict{2},SMALL.Problem.basedict{1})*SMALL.DL(i-1).D; 39 D = kron(SMALL.Problem.basedict{2},SMALL.Problem.basedict{1})*SMALL.DL(i-1).D;
37 else 40 else
38 D = SMALL.DL(i-1).D; 41 D = SMALL.DL(i-1).D;
39 end 42 end
40 dictimg = showdict(D,SMALL.Problem.blocksize,... 43 dictimg = SMALL_showdict(D,SMALL.Problem.blocksize,...
41 round(sqrt(size(D,2))),round(sqrt(size(D,2))),'lines','highcontrast'); 44 round(sqrt(size(D,2))),round(sqrt(size(D,2))),'lines','highcontrast');
42 45
43 subplot(2,m,m+i);imagesc(dictimg);axis off; axis image; 46 subplot(2,m,m+i);imagesc(dictimg);axis off; axis image;
44 title(sprintf('%s dictionary in %.2f s',... 47 title(sprintf('%s dictionary in %.2f s',...
45 SMALL.DL(i-1).name, SMALL.DL(i-1).time),'Interpreter','none'); 48 SMALL.DL(i-1).name, SMALL.DL(i-1).time),'Interpreter','none');