constrains_respY

PURPOSE ^

CONSTANTES_RESPY returns constants of the divisive normalization in DCT:

SYNOPSIS ^

function [H,kk1,kk2,gamm]=constrains_respY(gamm,cero,tipo_alfa);

DESCRIPTION ^

 CONSTANTES_RESPY returns constants of the divisive normalization in DCT:

 Alpha = CSF filter
 Beta = Saturation control
 Gamma = Exponent applied to the DCT
 H = Kernel of the divisive normalization

 It is assumed that fs = 64 cl/deg and the DCT block size is 16 * 16

 There are two general options for the parameters:

 * Gamma = 2 (respue3)
 * Gamma = 0.98 (respue4)

 Can also choose the type of CSF:

 * tipo_alfa = 1 CSF adjustment
 * tipo_alfa = 2 CSF Ngan (climbing as the setting)
 * tipo_alfa = 3 CSF Kelly (climbing as the setting)

  The diagonal of the kernel can be (or not) canceled.

 USE: [H,kk1,kk2,gamm]=constrains_resp(gamm,cero,tipo_alfa);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % CONSTANTES_RESPY returns constants of the divisive normalization in DCT:
0002 %
0003 % Alpha = CSF filter
0004 % Beta = Saturation control
0005 % Gamma = Exponent applied to the DCT
0006 % H = Kernel of the divisive normalization
0007 %
0008 % It is assumed that fs = 64 cl/deg and the DCT block size is 16 * 16
0009 %
0010 % There are two general options for the parameters:
0011 %
0012 % * Gamma = 2 (respue3)
0013 % * Gamma = 0.98 (respue4)
0014 %
0015 % Can also choose the type of CSF:
0016 %
0017 % * tipo_alfa = 1 CSF adjustment
0018 % * tipo_alfa = 2 CSF Ngan (climbing as the setting)
0019 % * tipo_alfa = 3 CSF Kelly (climbing as the setting)
0020 %
0021 %  The diagonal of the kernel can be (or not) canceled.
0022 %
0023 % USE: [H,kk1,kk2,gamm]=constrains_resp(gamm,cero,tipo_alfa);
0024 
0025 function [H,kk1,kk2,gamm]=constrains_respY(gamm,cero,tipo_alfa);
0026 
0027 fs=64;
0028 lcuan=16;
0029 
0030 if gamm==2
0031 
0032    CSFngan=[0.2320    0.8245    1.0000    0.9150    0.7311    0.5402    0.3795    0.2574    0.1701  0.1102    0.0703    0.0443    0.0276    0.0170    0.0104    0.0064];
0033    CSFkelly=[0.0040    0.7284    1.0000    0.7723    0.4712    0.2527    0.1249    0.0583    0.0262 0.0114    0.0048    0.0040    0.0040    0.0040    0.0040    0.0040];
0034    kk1 =[0.0305    0.1717    0.3160    0.2855    0.1735    0.1333    0.1211    0.1159    0.1021    0.0837    0.0636    0.0461    0.0330    0.0300  0.0301    0.0302];
0035 
0036    if tipo_alfa==2
0037       kk1=CSFngan*max(kk1);
0038    elseif tipo_alfa==3
0039       kk1=CSFkelly*max(kk1);
0040    end
0041 
0042    kk2 =[0.0109    0.0028    0.0022    0.0024    0.0034    0.0048    0.0064    0.0084    0.0094    0.0099    0.0102    0.0104    0.0106    0.01065 0.01073   0.01079];
0043    gamm=2;
0044    fact=0.6;
0045 
0046 else
0047 
0048    CSFngan=[0.2320    0.8245    1.0000    0.9150    0.7311    0.5402    0.3795    0.2574    0.1701  0.1102    0.0703    0.0443    0.0276    0.0170    0.0104    0.0064];
0049    CSFkelly=[0.0040    0.7284    1.0000    0.7723    0.4712    0.2527    0.1249    0.0583    0.0262 0.0114    0.0048    0.0040    0.0040    0.0040    0.0040    0.0040];
0050    kk1 = [0.0034    0.0194    0.0351    0.0316    0.0197    0.0151    0.0138    0.0131    0.0116    0.0092  0.0069    0.0050    0.0035    0.0032    0.0032    0.0032];
0051 
0052    if tipo_alfa==2
0053       kk1=CSFngan*max(kk1);
0054    elseif tipo_alfa==3
0055       kk1=CSFkelly*max(kk1);
0056    end
0057 
0058    kk2 = [0.0149    0.0040    0.0032    0.0034    0.0048    0.0066    0.0090    0.0117    0.0131    0.0131  0.0131    0.0131    0.0131    0.0131    0.0131    0.0131];
0059    gamm=0.9799;
0060    fact=0.5;
0061 end
0062 
0063    fx=linspace(0,fs/2-fs/(2*lcuan),lcuan);
0064 
0065    Fx=ones(lcuan,1)*fx;
0066    Fy=Fx';
0067    F=sqrt(Fx.^2+Fy.^2);
0068 
0069    fx=zigzag(Fx);
0070    fy=zigzag(Fy);
0071    f=zigzag(F);
0072 
0073    H=zeros(lcuan^2,lcuan^2);
0074    for i=1:lcuan^2
0075        s=fact*(1/3*f(i)+0.1);
0076        hh=exp(-((Fx-fx(i)).^2+(Fy-fy(i)).^2)/s.^2);
0077        if cero==1
0078           if i==1
0079              hh=zeros(lcuan,lcuan);
0080              hh(1,2)=0.333;
0081              hh(2,2)=0.333;
0082              hh(2,1)=0.333;
0083           else
0084              c1=Fx==fx(i);
0085              c2=Fy==fy(i);
0086              c=(c1.*c2)==0;
0087              hh=hh.*c;
0088           end
0089        end
0090        if i~=1
0091           hh(1,1)=0;
0092        end
0093        hh=hh/sum(sum(hh));
0094        H(i,:)=(zigzag(hh))';
0095    end

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