disdis7

PURPOSE ^

DISDIS7 applies the perceptual distortion measure:

SYNOPSIS ^

function [MSE,d,dx,MPEx,MPEoo,MPEexpesp]=disdis7(im1,im2,norm,exponente,fact_mask,expfrec,expesp);

DESCRIPTION ^

 DISDIS7 applies the perceptual distortion measure:

    dx(rx,rx+Drx) = ( (abs(Drx').^(expfrec/2)) * (abs(Drx).^(expfrec/2)) )^(1/expfrec)

 to the responses, rx(Ax), of each subblock, Ax, of the given images, im, im+Dim.
 (16*16 blocks assuming fs=64 cpd)

 It employs bock-DCT as local frequential domain before the normalization
 No spatial interactions are employed between blocks...

 The spatial differences in each block, dx, are added spatially
 by using the norm expesp:

                         /                \ ^ (1/expesp)
       d(im,im+Dim) =   |  sum dx^(expesp) |
                         \  x             /


 Moreover it gives a Maximum Perceptual Error map:

    MPEx = max( abs(Drxf) )

  and two average MPE:

  - With infinity norm:

     MPEoo  = max( MPEx )

  - With expesp norm:

                      /                  \ ^ (1/expesp)
       MPEexpesp =   |  sum MPEx^(expesp) |
                      \  x               /

 And also the MSE...


 USE: [MSE,d,dx,MPEx,MPEoo,MPEexpesp]=disdis7(im1,im2,[norm parametro],exponente_norm,fact_mask,expfrec,expesp);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 % DISDIS7 applies the perceptual distortion measure:
0003 %
0004 %    dx(rx,rx+Drx) = ( (abs(Drx').^(expfrec/2)) * (abs(Drx).^(expfrec/2)) )^(1/expfrec)
0005 %
0006 % to the responses, rx(Ax), of each subblock, Ax, of the given images, im, im+Dim.
0007 % (16*16 blocks assuming fs=64 cpd)
0008 %
0009 % It employs bock-DCT as local frequential domain before the normalization
0010 % No spatial interactions are employed between blocks...
0011 %
0012 % The spatial differences in each block, dx, are added spatially
0013 % by using the norm expesp:
0014 %
0015 %                         /                \ ^ (1/expesp)
0016 %       d(im,im+Dim) =   |  sum dx^(expesp) |
0017 %                         \  x             /
0018 %
0019 %
0020 % Moreover it gives a Maximum Perceptual Error map:
0021 %
0022 %    MPEx = max( abs(Drxf) )
0023 %
0024 %  and two average MPE:
0025 %
0026 %  - With infinity norm:
0027 %
0028 %     MPEoo  = max( MPEx )
0029 %
0030 %  - With expesp norm:
0031 %
0032 %                      /                  \ ^ (1/expesp)
0033 %       MPEexpesp =   |  sum MPEx^(expesp) |
0034 %                      \  x               /
0035 %
0036 % And also the MSE...
0037 %
0038 %
0039 % USE: [MSE,d,dx,MPEx,MPEoo,MPEexpesp]=disdis7(im1,im2,[norm parametro],exponente_norm,fact_mask,expfrec,expesp);
0040 %
0041 
0042 function [MSE,d,dx,MPEx,MPEoo,MPEexpesp]=disdis7(im1,im2,norm,exponente,fact_mask,expfrec,expesp);
0043 
0044    tam=size(im1);
0045    tam=tam(1);
0046 
0047    lcuan=16;
0048    Ncuan=log(tam/lcuan)/log(2);
0049    lados=[tam tam];
0050    imq=zeros(tam,tam);
0051    dctq=zeros(tam,tam);
0052    codq=zeros(tam,tam);
0053 
0054    posai=[tam tam]/2-round(tam/2);
0055    posbd=[tam tam]/2+round(tam/2);
0056    coorcuanai=floor([(posai(1)-1)/lcuan+1 (posai(2)-1)/lcuan+1]);
0057    coorcuanbd=floor([(posbd(1)-1)/lcuan+1 (posbd(2)-1)/lcuan+1]);
0058    if coorcuanai(1)<1
0059         coorcuanai(1)=1;
0060    end
0061    if coorcuanai(2)<1
0062         coorcuanai(2)=1;
0063    end
0064    if coorcuanbd(1)>(2^Ncuan)
0065         coorcuanbd(1)=2^Ncuan;
0066    end
0067    if coorcuanai(2)>(2^Ncuan)
0068         coorcuanbd(2)=2^Ncuan;
0069 
0070    end
0071 
0072    fs=64;
0073    cero=0;
0074    [H,kk1,kk2,gamm]=constrains_resp(exponente,cero);
0075 
0076    dcti1=dct2r(im1,Ncuan);
0077    [a1,Lm1]=contras2(dcti1,Ncuan,norm);
0078    DC1=Lm1*16;
0079 
0080    dcti2=dct2r(im2,Ncuan);
0081    [a2,Lm2]=contras2(dcti2,Ncuan,norm);
0082    DC2=Lm2*16;
0083 
0084 dx=zeros(coorcuanbd(1),coorcuanbd(2));
0085 MPEx=dx;
0086 
0087 fprintf('Computing MPE distortion measure using a non-linear response model\n');
0088 
0089    for ii=coorcuanai(1):coorcuanbd(1)
0090        fprintf('.');
0091        for jj=coorcuanai(2):coorcuanbd(2)
0092            iii=(ii-1)*lcuan+ceil(lcuan/2);
0093            jjj=(jj-1)*lcuan+ceil(lcuan/2);
0094            blo1=sacasub(a1,[iii jjj],[lcuan lcuan],0);
0095            blo2=sacasub(a2,[iii jjj],[lcuan lcuan],0);
0096 
0097            [IN,R1,GR,alfa,beta]=respue5(blo1,kk1,fact_mask*kk2,gamm,H,0);
0098            [IN,R2,GR,alfa,beta]=respue5(blo2,kk1,fact_mask*kk2,gamm,H,0);
0099 
0100            Drf=abs(R1-R2);
0101 
0102            dx(ii,jj)= sum(sum((Drf.^(expfrec/2)).*(Drf.^(expfrec/2)))).^(1/expfrec);
0103            MPEx(ii,jj)=max(max(Drf));
0104 
0105        end
0106    end
0107 
0108 fprintf('\n');
0109 
0110 d=(sum(sum(dx.^(expesp))))^(1/expesp);
0111 
0112 MPEexpesp=(sum(sum(MPEx.^(expesp))))^(1/expesp);
0113 MPEoo=max(max(MPEx));
0114 
0115 MSE = sum(sum( (im1-im2).^2 ))/(tam^2);

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