laplacianOfGaussian

Create laplacian of gaussian $(LINK3 http://homepages.inf.ed.ac.uk/rbf/HIPR2/log.htm, (LoG)) filter kernel.

Slice!(Contiguous, [2], T*)
laplacianOfGaussian
(
T = double
)
(
,
size_t width
,
size_t height
)

Parameters

sigma
Type: T

gaussian sigma variance value

width
Type: size_t

width of the kernel matrix

height
Type: size_t

height of the kernel matrix

Examples

1 t
2 {
3     import std.algorithm.comparison : equal;
4     import std.math : approxEqual;
5 
6     auto log = laplacianOfGaussian!float(0.84f, 3, 3);
7     auto expected = [0.147722, -0.00865228, 0.147722, -0.00865228,
8         -0.556277, -0.00865228, 0.147722, -0.00865228, 0.147722].sliced(3, 3);
9     assert(equal!approxEqual(log.flattened, expected.flattened)

Meta