Documentation ¶
Index ¶
- func CannyGray(img *image.Gray, lower float64, upper float64, radius float64, sigma float64) (*image.Gray, error)
- func CannyRGBA(img *image.RGBA, lower float64, upper float64, radius float64, sigma float64) (*image.Gray, error)
- func HorizontalSobelGray(gray *image.Gray, border padding.Border) (*image.Gray, error)
- func HorizontalSobelRGBA(img *image.RGBA, border padding.Border) (*image.Gray, error)
- func LaplacianGray(gray *image.Gray, border padding.Border, kernel LaplacianKernel) (*image.Gray, error)
- func LaplacianRGBA(img *image.RGBA, border padding.Border, kernel LaplacianKernel) (*image.Gray, error)
- func SobelGray(img *image.Gray, border padding.Border) (*image.Gray, error)
- func SobelRGBA(img *image.RGBA, border padding.Border) (*image.Gray, error)
- func VerticalSobelGray(gray *image.Gray, border padding.Border) (*image.Gray, error)
- func VerticalSobelRGBA(img *image.RGBA, border padding.Border) (*image.Gray, error)
- type LaplacianKernel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CannyGray ¶
func CannyGray(img *image.Gray, lower float64, upper float64, radius float64, sigma float64) (*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, radius float64, sigma float64) (*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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 )