build.lap {imagefx} | R Documentation |
Given an x and y dimension, build a five point stencil of matching dimensions whose values are either -4, 0, and 1 and whose sum = 0.
build.lap(xdim,ydim)
xdim |
x dimension of desired matrix output |
ydim |
y dimension of desired matrix output |
Note that if xdim
or ydim
are even, the stencil values will be off center. This can be a problem when using a Laplacian matrix for multiple filtering operations.
Matrix with dimensions equal to xdim
and ydim
with five point stencil located near the middle of the matrix (see Details).
Alex J.C. Witsil
## build a 5 point stencil laplacian
lap=build.lap(9,9)
image(lap)