function [ df ] = Derivatives_NGF_n( f,g, resolutions )

dh = 0.0001;

[rows,columns] = size(f);
t_y = -(rows-1)/2:(rows-1)/2; %defining vectors for mesh grid
t_x = -(columns-1)/2:(columns-1)/2; %defining vectors for mesh grid
mn = columns*rows;

[x_1,x_2] = meshgrid(t_x*resolutions(1),t_y*resolutions(2));
[fx, fy] = gradient(f, resolutions(1), resolutions(2));

df5 = f - fx*dh;
db5 = f - fx*(-dh);

df6 = f - fy*dh;
db6 = f - fy*(-dh);

d5 = (ngf_D2(df5,g,resolutions) - ngf_D2(db5,g,resolutions))/(2*dh);
d6 = (ngf_D2(df6,g,resolutions) - ngf_D2(db6,g,resolutions))/(2*dh);

df = [d5(:),d6(:)]';

end

