laplacian

Create negative laplacian 3x3 kernel matrix.

Creates laplacian kernel matrix using

$(D_CODE I - image Laplacian(I) = [a/4, (1-a)/4, a/4] 4/(a+1) * |(1-a)/4 -1 (1-a)/4| [a/4, (1-a)/4, a/4] )

Slice!(Contiguous, [2], T*)
laplacian
pure nothrow
(
T = double
)
(
T a = 0.
)
if (
isNumeric!T
)
in { assert (a >= 0 && a <= 1); }

Examples

t
{
    assert(laplacian().flattened == [0, 1, 0, 1, -4, 1, 0, 1, 0]

Meta