
function DIV = Divergence(II);
    [N1,N2,N3] = size(II);
    T1 = [2:N1 1]; T2 = [2:N2 1];
    DIV = (II(:,T2,1)-II(:,:,1))+ (II(T1,:,2)-II(:,:,2)); 
endfunction
