edgedetection

package
v0.0.0-...-d61e921 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CannyGray

func CannyGray(img *image.Gray, lower float64, upper float64, kernelSize uint) (*image.Gray, error)

CannyGray computes the edges of a given grayscale image using the Canny edge detection algorithm. The returned image is a grayscale image represented on 8 bits.

func CannyRGBA

func CannyRGBA(img *image.RGBA, lower float64, upper float64, kernelSize uint) (*image.Gray, error)

CannyRGBA computes the edges of a given RGBA image using the Canny edge detection algorithm. The returned image is a grayscale image represented on 8 bits.

func HorizontalSobelGray

func HorizontalSobelGray(gray *image.Gray, border padding.Border) (*image.Gray, error)

HorizontalSobelGray applies the horizontal Sobel operator (horizontal kernel) to a grayscale image. The result of the Sobel operator is a 2-dimensional map of the gradient at each point. More information on the Sobel operator: https://en.wikipedia.org/wiki/Sobel_operator

func HorizontalSobelRGBA

func HorizontalSobelRGBA(img *image.RGBA, border padding.Border) (*image.Gray, error)

HorizontalSobelRGBA applies the horizontal Sobel operator (horizontal kernel) to an RGGBA image. The result of the Sobel operator is a 2-dimensional map of the gradient at each point. More information on the Sobel operator: https://en.wikipedia.org/wiki/Sobel_operator

func LaplacianGray

func LaplacianGray(gray *image.Gray, border padding.Border, kernel LaplacianKernel) (*image.Gray, error)

LaplacianGray applies Laplacian filter to a grayscale image. The kernel types are: K4 and K8 (see LaplacianKernel) Example of usage:

res, err := edgedetection.LaplacianGray(img, paddding.BorderReflect, edgedetection.K8)

func LaplacianRGBA

func LaplacianRGBA(img *image.RGBA, border padding.Border, kernel LaplacianKernel) (*image.Gray, error)

LaplacianRGBA applies Laplacian filter to an RGBA image. The kernel types are: K4 and K8 (see LaplacianKernel) Example of usage:

res, err := edgedetection.LaplacianRGBA(img, paddding.BorderReflect, edgedetection.K8)

func SobelGray

func SobelGray(img *image.Gray, border padding.Border) (*image.Gray, error)

SobelGray combines the horizontal and the vertical gradients of a grayscale image. The result is grayscale image which contains the high gradients ("edges") marked as white.

func SobelRGBA

func SobelRGBA(img *image.RGBA, border padding.Border) (*image.Gray, error)

SobelRGBA combines the horizontal and the vertical gradients of an RGBA image. The result is grayscale image which contains the high gradients ("edges") marked as white.

func VerticalSobelGray

func VerticalSobelGray(gray *image.Gray, border padding.Border) (*image.Gray, error)

VerticalSobelGray applies the vertical Sobel operator (vertical kernel) to a grayscale image. The result of the Sobel operator is a 2-dimensional map of the gradient at each point. More information on the Sobel operator: https://en.wikipedia.org/wiki/Sobel_operator

func VerticalSobelRGBA

func VerticalSobelRGBA(img *image.RGBA, border padding.Border) (*image.Gray, error)

VerticalSobelRGBA applies the vertical Sobel operator (vertical kernel) to an RGBA image. The result of the Sobel operator is a 2-dimensional map of the gradient at each point. More information on the Sobel operator: https://en.wikipedia.org/wiki/Sobel_operator

Types

type LaplacianKernel

type LaplacianKernel int

LaplacianKernel - constant type for differentiating Laplacian kernels

const (
	// K4 Laplacian kernel:
	//	{0, 1, 0},
	//	{1, -4, 1},
	//	{0, 1, 0},
	K4 LaplacianKernel = iota
	// K8 Laplacian kernel:
	//	{0, 1, 0},
	//	{1, -8, 1},
	//	{0, 1, 0},
	K8
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL