computing_distortions

PURPOSE ^

It computes the RMSE, SSIM, lineal MPE, non-lineal MPE (param. JMLR)

SYNOPSIS ^

function [RMSE,SSIM,MPEl,MPEnlJMLR] = computing_distortions(Im,ImR,pesos)

DESCRIPTION ^

 It computes the RMSE, SSIM, lineal MPE, non-lineal MPE (param. JMLR)
 of a distorted image.

 Im    -> Original image
 ImR   -> Distorted image
 pesos -> Used in RGB images. Is a row vector with the weights for each YUV layer

 In chromatic images, MPE's does not need a previous YUV transform

 USE: [RMSE,SSIM,MPEl,MPEnlJMLR] = computing_distortions(Im,ImR,pesos)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 % It computes the RMSE, SSIM, lineal MPE, non-lineal MPE (param. JMLR)
0003 % of a distorted image.
0004 %
0005 % Im    -> Original image
0006 % ImR   -> Distorted image
0007 % pesos -> Used in RGB images. Is a row vector with the weights for each YUV layer
0008 %
0009 % In chromatic images, MPE's does not need a previous YUV transform
0010 %
0011 % USE: [RMSE,SSIM,MPEl,MPEnlJMLR] = computing_distortions(Im,ImR,pesos)
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) );

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