function [ cv,EQM]= lms3(mult1, mult2, mult3,C11,C22,C33)
WIN=3;
mu= 2* 10^-3
q1=C11;
q2=C22;
q3=C33;
q4=mult1;
q5=mult2;
q6=mult3;
% zoneA(350:400,1600:1900)
%zoneB(140:200,560:700)
%zoneC(50:100,800:1000)
%
[a,b]=size(C11);
qq1=log(abs(q1+eps));
qq2=log(abs(q2+eps));
qq3=log(abs(q3+eps));
qq4=log(abs(q4+eps));
qq5=log(abs(q5+eps));
qq6=log(abs(q6+eps));
%
% qq1=(abs(q1+eps));
% qq2=(abs(q2+eps));
% qq3=(abs(q3+eps));
% qq4=(abs(q4+eps));
% qq5=(abs(q5+eps));
% qq6=(abs(q6+eps));
% figure;image(256*abs(q4)/mean(mean(abs(q4))));colormap(gray)
% figure;image(256*abs(q5)/mean(mean(abs(q5))));colormap(gray)
% figure;image(256*abs(q6)/mean(mean(abs(q6))));colormap(gray)
%qqq=[qq1 qq2 qq3];
% [aa,bb]=size(q33);
a1=floor(WIN/2);
Q=zeros(1,18);
for x=a1+1:a-a1
for y=a1+1:b-a1
Q1= [qq1(x-1,y-1) qq1(x-1,y) qq1(x,y-1)];
Q2= [qq2(x-1,y-1) qq2(x-1,y) qq2(x,y-1)];
Q3= [qq3(x-1,y-1) qq3(x-1,y) qq3(x,y-1)];
Q4= [qq4(x-1,y-1) qq4(x-1,y) qq4(x,y-1)];
Q5= [qq5(x-1,y-1) qq5(x-1,y) qq5(x,y-1)];
Q6= [qq6(x-1,y-1) qq6(x-1,y) qq6(x,y-1)];
QQ1=Q1(:)';
QQ2=Q2(:)';
QQ3=Q3(:)';
QQ4=Q4(:)';
QQ5=Q5(:)';
QQ6=Q6(:)';
Q=[QQ1 QQ2 QQ3 QQ4 QQ5 QQ6];
P=Q;
B=zeros(6,length(P));
for L=1:10
R= (B*P')';
E1=qq1(x,y)-R(1);
E2=qq2(x,y)-R(2);
E3=qq3(x,y)-R(3);
E4=qq4(x,y)-R(4);
E5=qq5(x,y)-R(5);
E6=qq6(x,y)-R(6);
E=[E1 E2 E3 E4 E5 E6];
B =B+(mu*E'*P);
end
%polar=B*P;
pol=Q*B';
polar(x,y)=pol(1);
polar1(x,y)=pol(2);
polar2(x,y)=pol(3);
polar3(x,y)=pol(4);
polar4(x,y)=pol(5);
polar5(x,y)=pol(6);
end
end
polar=exp(polar);
polar1=exp(polar1);
polar2=exp(polar2);
polar3=exp(polar3);
polar4=exp(polar4);
polar5=exp(polar5);
% for i=2:aa-1
% for j=2:bb-1
% qq=q33(i,j);
% end
% end
%
%
% EQM =mean(mean(abs(qq(:)-polar2(:))))
%
%
% figure;image(256*polar/mean(mean(polar)));colormap(gray)
% figure;image(256*polar1/mean(mean(polar1)));colormap(gray)
% figure;image(256*polar2/mean(mean(polar2)));colormap(gray)
% figure;image(256*polar3/mean(mean(polar3)));colormap(gray)
figure;image(256*polar4/mean(mean(polar4)));colormap(gray)
% figure;image(256*polar5/mean(mean(polar5)));colormap(gray)
% poB=polar(140:200,560:700);
% poA =polar(350:400,1600:1900);
% qC= C11(50:100,800:1000);
% poC= polar(50:100,800:1000);
% cv= std(poA(:)) / mean(poA(:))
% % cvB=std(poB(:)) / mean(poB(:))
% EQM =mean(mean(abs(qC(:)- poC(:))))
% %
% % EQM =mean(mean(abs(qq4(:)- polar3(:))))
% BB= polar(140:200,560:700)
% cv= std(BB(:)) / mean(BB(:))
%
% CC= polar(50:100,800:1000)
% qC=C11(50:100,800:1000)
%
% EQM =mean(mean(abs(qC(:)- CC(:))))
%