% smooth image A using a binomial filters of order p (should be even)
function [SI] = BiSmooth(A,p);

X = [1 2 1]
c = 4

for i=2:2:p-2,
	  X = conv(X,[1 2 1]),
  c = c*4,
end;

I1 = filter2(X/c,A);
I2 = filter2(X'/c,I1);
SI = uint8(I2);

