%COMP 256 Assignment 1
%Adrian Ilie

function [fxy,fyx] = CrossDerivs(fx,fy)

fxy = diff(fx); 
% fxy has a 1/2 pixel shift in y direction.
ynew = 0.5:1:(size(fx,1)+0.5);
yold = 1:size(fx,1);

fxy = interp1(ynew(:),[fxy(1,:); fxy; fxy(end,:)],yold(:));


fyx = diff(fy'); 
% fyx has a 1/2 pixel shift in x direction.
xnew = 0.5:1:(size(fy,2)+0.5);
xold = 1:size(fy,2);

fyx = interp1(xnew(:),[fyx(1,:); fyx; fyx(end,:)],xold(:))';
