function [smdg] = smudge(img, sz)

dim = size(img);
x = 1:dim(1);
y = 1:dim(2);

sm = [];
sm(dim(1)+2*sz,dim(2)+2*sz) = 0;

for i=(-sz):sz,
  for j=(-sz):sz,
    cur = [];
    cur(dim(1)+2*sz,dim(2)+2*sz) = 0;
    cur((x+i+sz),(y+j+sz)) = img(x,y);
    sm = sm + cur;
  end
end

smdg = sm(x+sz,y+sz);
