function [nabla_N, nabla_S, nabla_E, nabla_W] = create_nearest_neighbor_difference_arrays(I)
    P = padarray(I, [1 1], 'replicate');
    
    nabla_N = P(1:size(I,1), 2:(size(I,2)+1))-I;
    nabla_S = P(3:(size(I,1)+2), 2:(size(I,2)+1))-I;
    nabla_E = P(2:(size(I,1)+1), 3:(size(I,2)+2))-I;
    nabla_W = P(2:(size(I,1)+1), 1:size(I,2))-I;
end