build.lap {imagefx} | R Documentation |
Build 5-Point Laplacian Stencil
Description
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.
Usage
build.lap(xdim,ydim)
Arguments
xdim |
x dimension of desired matrix output |
ydim |
y dimension of desired matrix output |
Details
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.
Value
Matrix with dimensions equal to xdim
and ydim
with five point stencil located near the middle of the matrix (see Details).
Author(s)
Alex J.C. Witsil
See Also
Examples
## build a 5 point stencil laplacian
lap=build.lap(9,9)
image(lap)
[Package imagefx version 0.4.1 Index]