constrains_respV

PURPOSE ^

CONSTANTES_RESP returns constants of the divisive normalization in DCT:

SYNOPSIS ^

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

DESCRIPTION ^

 CONSTANTES_RESP 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)

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

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % CONSTANTES_RESP 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 %  The diagonal of the kernel can be (or not) canceled.
0016 %
0017 % USE: [H,kk1,kk2,gamm]=constrains_resp(gamm,cero);
0018 
0019 function [H,kk1,kk2,gamm]=constrains_resp(gamm,cero);
0020 
0021 fs=64;
0022 lcuan=16;
0023 
0024 if gamm==2
0025 
0026 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];
0027 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];
0028 factores_sobre_crom=[0.75 0.55];
0029 CSFrg=(factores_sobre_crom(1)/0.65)*[0.6500    0.3062    0.1442    0.0679    0.0320    0.0151    0.0071    0.0033    0.0016   0.0007    0.0003    0.0002    0.0001       0.000036  0.000017  0.000008];
0030 CSFyb=(factores_sobre_crom(2)/0.5)*[0.5000    0.2092    0.0875    0.0366    0.0153    0.0064    0.0027    0.0011    0.0005   0.0002    0.0001    0.000034  0.000014     0.0000060  0.0000025  0.000001];
0031 
0032 alfaY =[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];
0033 alfaU =factores_sobre_crom(2)*max(alfaY)*CSFyb/max(CSFyb);
0034 alfaV =factores_sobre_crom(1)*max(alfaY)*CSFrg/max(CSFrg);
0035 
0036    kk1=alfaV;
0037    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];
0038    gamm=2;
0039    fact=0.6;
0040 
0041 else
0042 
0043 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];
0044 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];
0045 factores_sobre_crom=[0.75 0.55];
0046 CSFrg=(factores_sobre_crom(1)/0.65)*[0.6500    0.3062    0.1442    0.0679    0.0320    0.0151    0.0071    0.0033    0.0016   0.0007    0.0003    0.0002    0.0001       0.000036  0.000017  0.000008];
0047 CSFyb=(factores_sobre_crom(2)/0.5)*[0.5000    0.2092    0.0875    0.0366    0.0153    0.0064    0.0027    0.0011    0.0005   0.0002    0.0001    0.000034  0.000014     0.0000060  0.0000025  0.000001];
0048 
0049 alfaY =[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];
0050 alfaU =factores_sobre_crom(2)*max(alfaY)*CSFyb/max(CSFyb);
0051 alfaV =factores_sobre_crom(1)*max(alfaY)*CSFrg/max(CSFrg);
0052 
0053    kk1=alfaV/8;
0054    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];
0055    gamm=0.9799;
0056    fact=0.5;
0057 end
0058 
0059    fx=linspace(0,fs/2-fs/(2*lcuan),lcuan);
0060 
0061    Fx=ones(lcuan,1)*fx;
0062    Fy=Fx';
0063    F=sqrt(Fx.^2+Fy.^2);
0064 
0065    fx=zigzag(Fx);
0066    fy=zigzag(Fy);
0067    f=zigzag(F);
0068 
0069    H=zeros(lcuan^2,lcuan^2);
0070    for i=1:lcuan^2
0071        s=fact*(1/3*f(i)+0.1);
0072        hh=exp(-((Fx-fx(i)).^2+(Fy-fy(i)).^2)/s.^2);
0073        if cero==1
0074           if i==1
0075              hh=zeros(lcuan,lcuan);
0076              hh(1,2)=0.333;
0077              hh(2,2)=0.333;
0078              hh(2,1)=0.333;
0079           else
0080              c1=Fx==fx(i);
0081              c2=Fy==fy(i);
0082              c=(c1.*c2)==0;
0083              hh=hh.*c;
0084           end
0085        end
0086        if i~=1
0087           hh(1,1)=0;
0088        end
0089        hh=hh/sum(sum(hh));
0090        H(i,:)=(zigzag(hh))';
0091    end

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