function y = Poincare(f, blockSize);

sze = size(f);
sze = sze(1);
sze = sze - (blockSize-1);

ptOffsets = [0 0; 1 0; 1 1; 0 1];


for k = 1:sze
   for j = 1:sze
      temp = 0;
      for l = 1:(blockSize^2-1)
         ptTwo = f(k+ptOffsets(l+1,1), j+ptOffsets(l+1,2));
         ptOne = f(k+ptOffsets(l,1),   j+ptOffsets(l,2));
         temp = temp + (ptTwo-ptOne);
      end
      tempAngSub(k,j) = temp;
   end
end

y = tempAngSub;