Mercurial > hg > smallbox
comparison util/SMALL_ImgDeNoiseResult.m @ 34:9ff69e8e049f backup 14032011
(none)
author | idamnjanovic |
---|---|
date | Mon, 14 Mar 2011 14:15:08 +0000 |
parents | fc395272d53e |
children | ea9ef4bd7102 |
comparison
equal
deleted
inserted
replaced
33:f6b49c9d728c | 34:9ff69e8e049f |
---|---|
27 subplot(2,m,m+1); imshow(imnoise/maxval); | 27 subplot(2,m,m+1); imshow(imnoise/maxval); |
28 title(sprintf('Noisy image, PSNR = %.2fdB', 20*log10(maxval * sqrt(numel(im)) / norm(im(:)-imnoise(:))) )); | 28 title(sprintf('Noisy image, PSNR = %.2fdB', 20*log10(maxval * sqrt(numel(im)) / norm(im(:)-imnoise(:))) )); |
29 | 29 |
30 for i=2:m | 30 for i=2:m |
31 params=SMALL.solver(i-1).param; | 31 params=SMALL.solver(i-1).param; |
32 subplot(2, m, i); imshow(SMALL.solver(i-1).reconstructed.Image/maxval); | 32 subplot(2, m, i); imagesc(SMALL.solver(i-1).reconstructed.Image/maxval);colormap(gray); |
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 )); |
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,params.blocksize,... | 40 dictimg = showdict(D,params.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);imshow(imresize(dictimg,2,'nearest')); | 43 subplot(2,m,m+i);imagesc(dictimg);colormap(gray); |
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)); |
46 | 46 |
47 end | 47 end |