build.lap: Build 5-Point Laplacian Stencil

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/build.lap.r

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

1
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

build.gaus

Examples

1
2
3
## build a 5 point stencil laplacian
lap=build.lap(9,9)
image(lap)

imagefx documentation built on Feb. 14, 2020, 1:07 a.m.