2D filtering
A 2D image f[i,j] can be filtered by a 2D kernel
h[u,v] to produce an output image g[i,j]:
This is called a cross-correlation operation and
written:
h is called the “filter,”  “kernel,”  or “mask.”
The above allows negative filter indices.  When
you implement need to use:  h[u+k,v+k] instead of
h[u,v]