1 % BM3D-SAPCA : BM3D with Shape-Adaptive Principal Component Analysis (v1.00, 2009)
4 % BM3D-SAPCA is an algorithm for attenuation of additive white Gaussian noise (AWGN)
5 % from grayscale images. This algorithm reproduces the results from the article:
6 % K. Dabov, A. Foi, V. Katkovnik, and K. Egiazarian, "BM3D Image Denoising with
7 % Shape-Adaptive Principal Component Analysis", Proc. Workshop on Signal Processing
8 % with Adaptive Sparse Structured Representations (SPARS'09), Saint-Malo, France,
9 % April 2009. (PDF available at http://www.cs.tut.fi/~foi/GCF-BM3D )
14 % y_est = BM3DSAPCA2009(z, sigma)
16 % where z is an image corrupted by AWGN with noise standard deviation sigma
17 % and y_est is an estimate of the noise-free image.
18 % Signals are assumed on the intensity range [0,1].
23 % y = im2double(imread('Cameraman256.png'));
25 % z=y+sigma*randn(size(y));
26 % y_est = BM3DSAPCA2009(z,sigma);
30 % Copyright (c) 2009-2011 Tampere University of Technology. All rights reserved.
31 % This work should only be used for nonprofit purposes.
33 % author: Alessandro Foi, email: firstname.lastname@tut.fi
39 y = im2double(imread('Cameraman256.png'));
40 % y = im2double(imread('Lena512.png'));
44 z=y+sigma*randn(size(y));
46 y_est = BM3DSAPCA2009(z,sigma);
48 PSNR = 10*log10(1/mean((y(:)-y_est(:)).^2));
49 disp(['PSNR = ',num2str(PSNR)])
50 if exist('ssim_index')
51 [mssim ssim_map] = ssim_index(y*255, y_est*255);
52 disp(['SSIM = ',num2str(mssim)])