Documentation ¶
Index ¶
- func GaussianKernel32(khalf int, sigma float32) []float32
- func GaussianKernel64(khalf int, sigma float64) []float64
- func Slice32(dest *[]float32, src []float32, kern []float32) error
- func Slice64(dest *[]float64, src []float64, kern []float64) error
- func SmoothTable(src *table.Table, khalf int) *table.Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GaussianKernel32 ¶
GaussianKernel32 returns a normalized gaussian kernel for smoothing with given half-width and normalized sigma (actual sigma = khalf * sigma). A sigma value of .5 is typical for smaller half-widths for containing most of the gaussian efficiently -- anything lower than .33 is inefficient -- generally just use a lower half-width instead.
func GaussianKernel64 ¶
GaussianKernel64 returns a normalized gaussian kernel with given half-width and normalized sigma (actual sigma = khalf * sigma) A sigma value of .5 is typical for smaller half-widths for containing most of the gaussian efficiently -- anything lower than .33 is inefficient -- generally just use a lower half-width instead.
func Slice32 ¶
Slice32 convolves given kernel with given source slice, putting results in destination, which is ensured to be the same size as the source slice, using existing capacity if available, and otherwise making a new slice. The kernel should be normalized, and odd-sized do it is symmetric about 0. Returns an error if sizes are not valid. No parallelization is used -- see Slice32Parallel for very large slices. Edges are handled separately with renormalized kernels -- they can be clipped from dest by excluding the kernel half-width from each end.
func Slice64 ¶
Slice64 convolves given kernel with given source slice, putting results in destination, which is ensured to be the same size as the source slice, using existing capacity if available, and otherwise making a new slice. The kernel should be normalized, and odd-sized do it is symmetric about 0. Returns an error if sizes are not valid. No parallelization is used -- see Slice64Parallel for very large slices. Edges are handled separately with renormalized kernels -- they can be clipped from dest by excluding the kernel half-width from each end.
func SmoothTable ¶
SmoothTable returns a cloned table with each of the floating-point columns in the source table smoothed over rows. khalf is the half-width of the Gaussian smoothing kernel, where larger values produce more smoothing. A sigma of .5 is used for the kernel.
Types ¶
This section is empty.