comparison util/SMALL_ImgDeNoiseResult.m @ 77:62f20b91d870

add routines from sparco problems privite folder to {root}\util some changes to ksvd vs rlsdla image denoising example
author Ivan <ivan.damnjanovic@eecs.qmul.ac.uk>
date Fri, 25 Mar 2011 14:01:50 +0000
parents ea9ef4bd7102
children 921f9931c84f
comparison
equal deleted inserted replaced
76:d052ec5b742f 77:62f20b91d870
19 m=size(SMALL.solver,2)+1; 19 m=size(SMALL.solver,2)+1;
20 maxval=SMALL.Problem.maxval; 20 maxval=SMALL.Problem.maxval;
21 im=SMALL.Problem.Original; 21 im=SMALL.Problem.Original;
22 imnoise=SMALL.Problem.Noisy; 22 imnoise=SMALL.Problem.Noisy;
23 23
24 subplot(2, m, 1); imshow(im/maxval); 24 subplot(2, m, 1); imagesc(im/maxval);colormap(gray);axis off; axis image; % Set aspect ratio to obtain square pixels
25 title('Original image'); 25 title('Original image');
26 26
27 subplot(2,m,m+1); imshow(imnoise/maxval); 27 subplot(2,m,m+1); imagesc(imnoise/maxval);axis off; axis image;
28 title(sprintf('Noisy image, PSNR = %.2fdB', SMALL.Problem.noisy_psnr )); 28 title(sprintf('Noisy image, PSNR = %.2fdB', SMALL.Problem.noisy_psnr ));
29 29
30 for i=2:m 30 for i=2:m
31 31
32 subplot(2, m, i); imagesc(SMALL.solver(i-1).reconstructed.Image/maxval);colormap(gray); 32 subplot(2, m, i); imagesc(SMALL.solver(i-1).reconstructed.Image/maxval);axis off; axis image;
33 title(sprintf('%s Denoised image, PSNR: %.2f dB in %.2f s',... 33 title(sprintf('%s Denoised image, PSNR: %.2f dB in %.2f s',...
34 SMALL.DL(i-1).name, SMALL.solver(i-1).reconstructed.psnr, SMALL.solver(i-1).time )); 34 SMALL.DL(i-1).name, SMALL.solver(i-1).reconstructed.psnr, SMALL.solver(i-1).time ),'Interpreter','none');
35 if strcmpi(SMALL.DL(i-1).name,'ksvds') 35 if strcmpi(SMALL.DL(i-1).name,'ksvds')
36 D = kron(SMALL.Problem.basedict{2},SMALL.Problem.basedict{1})*SMALL.DL(i-1).D; 36 D = kron(SMALL.Problem.basedict{2},SMALL.Problem.basedict{1})*SMALL.DL(i-1).D;
37 else 37 else
38 D = SMALL.DL(i-1).D; 38 D = SMALL.DL(i-1).D;
39 end 39 end
40 dictimg = showdict(D,SMALL.Problem.blocksize,... 40 dictimg = showdict(D,SMALL.Problem.blocksize,...
41 round(sqrt(size(D,2))),round(sqrt(size(D,2))),'lines','highcontrast'); 41 round(sqrt(size(D,2))),round(sqrt(size(D,2))),'lines','highcontrast');
42 42
43 subplot(2,m,m+i);imagesc(dictimg);colormap(gray); 43 subplot(2,m,m+i);imagesc(dictimg);axis off; axis image;
44 title(sprintf('%s dictionary in %.2f s',... 44 title(sprintf('%s dictionary in %.2f s',...
45 SMALL.DL(i-1).name, SMALL.DL(i-1).time)); 45 SMALL.DL(i-1).name, SMALL.DL(i-1).time),'Interpreter','none');
46 46
47 end 47 end