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