Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Kernel ¶
type Kernel interface { // Weights returns the square matrix of weights in row major order. Weights() []float64 }
Kernel is a square matrix that defines a convolution.
type SeparableKernel ¶
type SeparableKernel struct {
X, Y []float64
}
SeparableKernel is a linearly separable, square convolution kernel. X and Y are the per-axis weights. Each slice must be the same length, and have an odd length. The middle element of each slice is the weight for the central pixel. For example, the horizontal Sobel kernel is:
sobelX := &SeparableKernel{ X: []float64{-1, 0, +1}, Y: []float64{1, 2, 1}, }
func (*SeparableKernel) Weights ¶
func (k *SeparableKernel) Weights() []float64
Click to show internal directories.
Click to hide internal directories.