function gj = gj(theta;[yj;f(:)]]);
0001 function g = gj(t,p) 0002 %function gj = gj(theta;[yj;f(:)]]); 0003 0004 N = sqrt(length(p)-2); 0005 Nf = (N-1)/2; 0006 f = reshape(p(3:end),N,N); 0007 0008 A = [t(1) t(3) t(5);t(2) t(4) t(6); 0 0 1]; 0009 xh = A*[p(1);p(2);1]; % real coordinates in f (centred) 0010 xc=xh(1); 0011 yc=xh(2); 0012 x=xc+Nf+1; % pixel coordinates in f 0013 y=yc+Nf+1; 0014 g = 1/t(7)*(LSM_f_cubic_interpolation(x,y,f)-t(8)); 0015 end 0016