computing_distortions_c

PURPOSE ^

It computes RMSE, SSIM, linear MPE, non-linear MPE and non-linear JMLR MPE

SYNOPSIS ^

function [RMSE,SSIM,MPEl,MPEnlJMLR,SCIELab] = computing_distortions_c(Im,ImR,pesos,exp_sum)

DESCRIPTION ^

 It computes RMSE, SSIM, linear MPE, non-linear MPE and non-linear JMLR MPE
 for a distorted image.

 Im      -> Original Image
 ImR     -> Distorted Imagen
 pesos   -> Vector with weights for each YUV layer (color images).
 exp_sum -> Pooling exponent (for SCIELab).

 In achormatic images, MPE's does not need and extra YUV transform.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 % It computes RMSE, SSIM, linear MPE, non-linear MPE and non-linear JMLR MPE
0003 % for a distorted image.
0004 %
0005 % Im      -> Original Image
0006 % ImR     -> Distorted Imagen
0007 % pesos   -> Vector with weights for each YUV layer (color images).
0008 % exp_sum -> Pooling exponent (for SCIELab).
0009 %
0010 % In achormatic images, MPE's does not need and extra YUV transform.
0011 
0012 function [RMSE,SSIM,MPEl,MPEnlJMLR,SCIELab] = computing_distortions_c(Im,ImR,pesos,exp_sum)
0013 Im = double(Im);
0014 ImR= double(ImR);
0015 if(nargin < 3)
0016     pesos = [1/3 1/3 1/3];
0017     exp_sum = 1;
0018 elseif(nargin < 4)
0019     exp_sum = 1;
0020 end
0021 [Nf Nc N] = size(Im);
0022 RMSEn = zeros(N,1);
0023 SSIMn = zeros(N,1);
0024 RMSE = 0;
0025 SSIM = 0;
0026 MPEl = 0;
0027 MPEnlJMLR = 0;
0028 if(N == 3)
0029 
0030     ImYUV = my_rgb2yuv(double(Im));
0031     ImRYUV = my_rgb2yuv(double(ImR));
0032 end
0033 for capa = 1:N
0034     if(N == 3)
0035 
0036         SSIMn(capa) = 0;
0037     else
0038 
0039         SSIMn(capa) = 0;
0040     end
0041 end
0042 for i = 1:N
0043 
0044     SSIM = SSIM + pesos(i) * SSIMn(i);
0045 end
0046 RMSE = sqrt( sum((Im(:)-ImR(:)).^2) / numel(Im) );
0047 if((nargout > 4) && (N == 3))
0048     Im = double(Im);
0049     ImR = double(ImR);
0050 
0051     SCIELab = 0;
0052 end

Generated on Fri 07-Mar-2014 13:29:20 by m2html © 2005