Mercurial > hg > smallbox
comparison util/SMALL_ImgDeNoiseResult.m.orig @ 158:855aa3288394 danieleb
no message
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Wed, 31 Aug 2011 10:37:57 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
157:00a8473e4b85 | 158:855aa3288394 |
---|---|
1 function SMALL_ImgDeNoiseResult(SMALL) | |
2 %% Represents the results of Dictionary Learning for Image denoising | |
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 | |
9 % Centre for Digital Music, Queen Mary, University of London. | |
10 % This file copyright 2010 Ivan Damnjanovic. | |
11 % | |
12 % This program is free software; you can redistribute it and/or | |
13 % modify it under the terms of the GNU General Public License as | |
14 % published by the Free Software Foundation; either version 2 of the | |
15 % License, or (at your option) any later version. See the file | |
16 % COPYING included with this distribution for more information. | |
17 %% | |
18 | |
19 | |
20 figure('Name', sprintf('Image %s (training set size- %d, sigma - %d)',SMALL.Problem.name, SMALL.Problem.n, SMALL.Problem.sigma)); | |
21 | |
22 m=size(SMALL.solver,2)+1; | |
23 maxval=SMALL.Problem.maxval; | |
24 im=SMALL.Problem.Original; | |
25 imnoise=SMALL.Problem.Noisy; | |
26 | |
27 subplot(2, m, 1); imagesc(im/maxval);colormap(gray);axis off; axis image; % Set aspect ratio to obtain square pixels | |
28 title('Original image'); | |
29 | |
30 subplot(2,m,m+1); imagesc(imnoise/maxval);axis off; axis image; | |
31 title(sprintf('Noisy image, PSNR = %.2fdB', SMALL.Problem.noisy_psnr )); | |
32 | |
33 for i=2:m | |
34 | |
35 subplot(2, m, i); imagesc(SMALL.solver(i-1).reconstructed.Image/maxval);axis off; axis image; | |
36 title(sprintf('%s Denoised image, PSNR: %.2f dB in %.2f s',... | |
37 SMALL.DL(i-1).name, SMALL.solver(i-1).reconstructed.psnr, SMALL.solver(i-1).time ),'Interpreter','none'); | |
38 if strcmpi(SMALL.DL(i-1).name,'ksvds') | |
39 D = kron(SMALL.Problem.basedict{2},SMALL.Problem.basedict{1})*SMALL.DL(i-1).D; | |
40 else | |
41 D = SMALL.DL(i-1).D; | |
42 end | |
43 dictimg = SMALL_showdict(D,SMALL.Problem.blocksize,... | |
44 round(sqrt(size(D,2))),round(sqrt(size(D,2))),'lines','highcontrast'); | |
45 | |
46 subplot(2,m,m+i);imagesc(dictimg);axis off; axis image; | |
47 title(sprintf('%s dictionary in %.2f s',... | |
48 SMALL.DL(i-1).name, SMALL.DL(i-1).time),'Interpreter','none'); | |
49 | |
50 end |