constrains_respU

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 function [H,kk1,kk2,gamm]=constrains_resp(gamm,cero);
0019 
0020 fs=64;
0021 lcuan=16;
0022 
0023 if gamm==2
0024 
0025 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];
0026 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];
0027 factores_sobre_crom=[0.75 0.55];
0028 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];
0029 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];
0030 
0031 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];
0032 alfaU =factores_sobre_crom(2)*max(alfaY)*CSFyb/max(CSFyb);
0033 alfaV =factores_sobre_crom(1)*max(alfaY)*CSFrg/max(CSFrg);
0034 
0035    kk1 = alfaU;
0036    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];
0037    gamm=2;
0038    fact=0.6;
0039 
0040 else
0041 
0042 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];
0043 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];
0044 factores_sobre_crom=[0.75 0.55];
0045 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];
0046 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];
0047 
0048 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];
0049 alfaU =factores_sobre_crom(2)*max(alfaY)*CSFyb/max(CSFyb);
0050 alfaV =factores_sobre_crom(1)*max(alfaY)*CSFrg/max(CSFrg);
0051 
0052    kk1 = alfaU/8;
0053    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];
0054    gamm=0.9799;
0055    fact=0.5;
0056 end
0057 
0058    fx=linspace(0,fs/2-fs/(2*lcuan),lcuan);
0059 
0060    Fx=ones(lcuan,1)*fx;
0061    Fy=Fx';
0062    F=sqrt(Fx.^2+Fy.^2);
0063 
0064    fx=zigzag(Fx);
0065    fy=zigzag(Fy);
0066    f=zigzag(F);
0067 
0068    H=zeros(lcuan^2,lcuan^2);
0069    for i=1:lcuan^2
0070        s=fact*(1/3*f(i)+0.1);
0071        hh=exp(-((Fx-fx(i)).^2+(Fy-fy(i)).^2)/s.^2);
0072        if cero==1
0073           if i==1
0074              hh=zeros(lcuan,lcuan);
0075              hh(1,2)=0.333;
0076              hh(2,2)=0.333;
0077              hh(2,1)=0.333;
0078           else
0079              c1=Fx==fx(i);
0080              c2=Fy==fy(i);
0081              c=(c1.*c2)==0;
0082              hh=hh.*c;
0083           end
0084        end
0085        if i~=1
0086           hh(1,1)=0;
0087        end
0088        hh=hh/sum(sum(hh));
0089        H(i,:)=(zigzag(hh))';
0090    end

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