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