0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 function [RMSE,SSIM,MPEl,MPEnlJMLR] = computing_distortions(Im,ImR,pesos)
0014 if(nargin < 3)
0015 pesos = 1;
0016 end
0017 N = size(Im,3);
0018 SSIMn = zeros(N,1);
0019 MPEln = zeros(N,1);
0020 MPEnlJMLRn = zeros(N,1);
0021 SSIM = 0;
0022 MPEl = 0;
0023 MPEnlJMLR = 0;
0024 if(N == 3)
0025
0026 ImYUV = my_rgb2yuv(double(Im));
0027 ImRYUV = my_rgb2yuv(double(ImR));
0028 end
0029 for capa = 1:N
0030
0031 SSIMn(capa) = ssim_index(double(Im(:,:,capa)),ImR(:,:,capa));
0032 if(N == 3)
0033
0034 [MSE,MPEln(capa),dx0,MPEx0,MPEoo0,MPEexpesp0] = disdis_lineal(double(ImYUV(:,:,capa)),ImRYUV(:,:,capa),2,[3 mean(mean(ImYUV(:,:,capa)))],2,2);
0035
0036 [MSE,MPEnlJMLRn(capa),dx,MPEx,MPEoo,MPEexpesp] = disdis7(double(ImYUV(:,:,capa)),ImRYUV(:,:,capa),[3 mean(mean(ImYUV(:,:,capa)))],1,0.5,2,2);
0037 else
0038
0039 [MSE,MPEln(capa),dx0,MPEx0,MPEoo0,MPEexpesp0] = disdis_lineal(double(Im),ImR,2,[3 mean(mean(Im))],2,2);
0040
0041 [MSE,MPEnlJMLRn(capa),dx,MPEx,MPEoo,MPEexpesp] = disdis7(double(Im),ImR,[3 mean(mean(Im))],1,0.5,2,2);
0042 end
0043 end
0044 for i = 1:N
0045
0046 SSIM = SSIM + pesos(i) * SSIMn(i);
0047
0048 MPEl = MPEl + pesos(i) * MPEln(i);
0049
0050 MPEnlJMLR = MPEnlJMLR + pesos(i) * MPEnlJMLRn(i);
0051 end
0052 RMSE = sqrt( sum((Im(:) - ImR(:)) .^ 2) / numel(Im) );