comparison util/vmrse_type2.m @ 38:84b7c44e54c4

(none)
author idamnjanovic
date Mon, 14 Mar 2011 15:33:18 +0000
parents
children
comparison
equal deleted inserted replaced
37:d80c103d9876 38:84b7c44e54c4
1 function [RMSErn, RMSEcd, rn_im, cd_im] = vmrse_type2(orig, corr, recon)
2
3 %%% Implementation of VectorRMSE type2
4 %
5 % Centre for Digital Music, Queen Mary, University of London.
6 % This file copyright 2011 Ivan Damnjanovic.
7 %
8 % This program is free software; you can redistribute it and/or
9 % modify it under the terms of the GNU General Public License as
10 % published by the Free Software Foundation; either version 2 of the
11 % License, or (at your option) any later version. See the file
12 % COPYING included with this distribution for more information.
13 %
14 % Input:
15 % - Original image
16 % - Corrupted image
17 % - Reconstructed Image
18 %
19 % Output:
20 % - RMSErn - RMSE from residual noise (noise not completely removed)
21 % - RMSEcd - RMSE from collateral distortion - excessive filtering
22 % - rn_im - image of residual noise
23 % - cd_im - image of collateral distortion
24 %
25 % F. Russo, "New Method for Performance Evaluation of Grayscale Image
26 % Denoising filters", IEEE Signal Processing Letters, vol. 17, no. 5,
27 % pp.417-420, May 2010
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