comparison util/SMALL_vmrse_type2.m @ 127:6f78b069e541

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