addpath ~/matlab/UTILITY

scalespace=im1;

for i=2:5
  gf=fspecial('gaussian',25,5*(i-1));
  scalespace(:,:,i)=conv2(double(im1),gf,'same');
end

showSerTight(scalespace,1);


for i=1:4
  dogs(:,:,i)=scalespace(:,:,i+1)-scalespace(:,:,i);
end


f2=dogs(:,:,2);
subplot(2,2,1);
imagesc(f2);

px=f2-circshift(f2,[0 1]);
subplot(2,2,2);
imagesc(px);

py=f2-circshift(f2,[1 0]);
subplot(2,2,3);
imagesc(py);

mags=sqrt(px.^2+py.^2);