ivan@117
|
1 function [RMSErn, RMSEcd, rn_im, cd_im] = SMALL_vmrse_type2(orig, corr, recon)
|
ivan@117
|
2 %% Implementation of VectorRMSE type2
|
ivan@117
|
3 %
|
ivan@117
|
4 %
|
ivan@117
|
5 % Input:
|
ivan@117
|
6 % - Original image
|
ivan@117
|
7 % - Corrupted image
|
ivan@117
|
8 % - Reconstructed Image
|
ivan@117
|
9 %
|
ivan@117
|
10 % Output:
|
ivan@117
|
11 % - RMSErn - RMSE from residual noise (noise not completely removed)
|
ivan@117
|
12 % - RMSEcd - RMSE from collateral distortion - excessive filtering
|
ivan@117
|
13 % - rn_im - image of residual noise
|
ivan@117
|
14 % - cd_im - image of collateral distortion
|
ivan@117
|
15 %
|
ivan@117
|
16 % F. Russo, "New Method for Performance Evaluation of Grayscale Image
|
ivan@117
|
17 % Denoising filters", IEEE Signal Processing Letters, vol. 17, no. 5,
|
ivan@117
|
18 % pp.417-420, May 2010
|
ivan@117
|
19
|
ivan@117
|
20 % Centre for Digital Music, Queen Mary, University of London.
|
ivan@117
|
21 % This file copyright 2011 Ivan Damnjanovic.
|
ivan@117
|
22 %
|
ivan@117
|
23 % This program is free software; you can redistribute it and/or
|
ivan@117
|
24 % modify it under the terms of the GNU General Public License as
|
ivan@117
|
25 % published by the Free Software Foundation; either version 2 of the
|
ivan@117
|
26 % License, or (at your option) any later version. See the file
|
ivan@117
|
27 % COPYING included with this distribution for more information.
|
ivan@117
|
28 %%
|
ivan@117
|
29
|
ivan@117
|
30 recon_int = round(recon);
|
ivan@117
|
31
|
ivan@117
|
32 RN1 = ((orig<recon_int)&(recon_int<=corr));
|
ivan@117
|
33 RN2 = ((orig>recon_int)&(recon_int>=corr));
|
ivan@117
|
34 CD1 = ((orig<recon_int)&(recon_int>corr));
|
ivan@117
|
35 CD2 = ((orig>recon_int)&(recon_int<corr));
|
ivan@117
|
36
|
ivan@117
|
37 RMSErn = sqrt(sum(sum((RN1+RN2).*(orig-recon).^2)))/512;
|
ivan@117
|
38 RMSEcd = sqrt(sum(sum((CD1+CD2).*(orig-recon).^2)))/512;
|
ivan@117
|
39 rn_im=RN1+RN2;
|
ivan@117
|
40 cd_im=CD1+CD2;
|
ivan@117
|
41
|
ivan@117
|
42 end
|
ivan@117
|
43
|