mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.2 KiB
36 lines
1.2 KiB
// Copyright (c) Six Labors.
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
|
namespace SixLabors.ImageSharp.Processing.Processors.Convolution
|
|
{
|
|
/// <summary>
|
|
/// Contains Laplacian kernels of different sizes.
|
|
/// <see href="http://en.wikipedia.org/wiki/Discrete_Laplace_operator"/>
|
|
/// <see href="http://fourier.eng.hmc.edu/e161/lectures/gradient/node8.html"/>.
|
|
/// </summary>
|
|
internal static class LaplacianKernels
|
|
{
|
|
/// <summary>
|
|
/// Gets the 3x3 Laplacian kernel
|
|
/// </summary>
|
|
public static DenseMatrix<float> Laplacian3x3 => LaplacianKernelFactory.CreateKernel(3);
|
|
|
|
/// <summary>
|
|
/// Gets the 5x5 Laplacian kernel
|
|
/// </summary>
|
|
public static DenseMatrix<float> Laplacian5x5 => LaplacianKernelFactory.CreateKernel(5);
|
|
|
|
/// <summary>
|
|
/// Gets the Laplacian of Gaussian kernel.
|
|
/// </summary>
|
|
public static DenseMatrix<float> LaplacianOfGaussianXY =>
|
|
new float[,]
|
|
{
|
|
{ 0, 0, -1, 0, 0 },
|
|
{ 0, -1, -2, -1, 0 },
|
|
{ -1, -2, 16, -2, -1 },
|
|
{ 0, -1, -2, -1, 0 },
|
|
{ 0, 0, -1, 0, 0 }
|
|
};
|
|
}
|
|
}
|
|
|