Table of Contents

Enum EdgeOperator

Namespace
Egami.Operations
Assembly
Egami.dll

The kernels Edges(EdgeOperator, bool) finds edges with. Every operator is scaled so a full black-to-white step gives 1 at its strongest pixel; stronger responses (corners, single bright pixels) clamp to 1.

public enum EdgeOperator

Fields

Kirsch = 4

Kirsch's eight 3 × 3 compass kernels (5 on one side, −3 on the others); the strongest response is kept.

Laplacian3x3 = 6

The 3 × 3 Laplacian (8 in the middle, −1 around it), as an absolute value: edges come out as thin double lines.

Laplacian5x5 = 7

The 5 × 5 Laplacian (24 in the middle, −1 around it), as an absolute value.

LaplacianOfGaussian = 8

The 5 × 5 Laplacian of Gaussian (16 in the middle, then −2, −1), as an absolute value: smoothed against noise.

Prewitt = 2

Prewitt's 3 × 3 pair, weights 1, 1, 1 across the derivative.

RobertsCross = 3

Roberts' 2 × 2 cross of diagonal differences, the pixel and the one below and to its right: the sharpest and noisiest.

Robinson = 5

Robinson's eight 3 × 3 compass kernels with weights 1, 2, 1 (Sobel's, turned in 45° steps); the strongest response is kept.

Scharr = 1

Scharr's 3 × 3 pair (weights 3, 10, 3), whose magnitude depends least on the edge's direction.

Sobel = 0

Sobel and Feldman's 3 × 3 pair, weights 1, 2, 1 across the derivative: the usual choice.

Examples

using Raster edges = photo.Derive(o => o.Edges(), Ct);                                  // Sobel, gray, 0 to 1
using Raster crisp = photo.Derive(o => o.Edges(EdgeOperator.Scharr), Ct);              // rotation-steady
using Raster colored = photo.Derive(o => o.Edges(EdgeOperator.Sobel, grayscale: false), Ct);  // per channel
using Raster lines = photo.Derive(o => o.Blur(1).Edges(EdgeOperator.Laplacian3x3), Ct); // second derivative