api

package
v0.0.0-...-efd74f4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const BLACK = 0
View Source
const WHITE = 255

Variables

View Source
var (
	SobelDx = &sobel{mat: [3][3]float64{{-1, 0, 1}, {-2, 0, 2}, {-1, 0, 1}}}
	SobelDy = &sobel{mat: [3][3]float64{{-1, -2, -1}, {0, 0, 0}, {1, 2, 1}}}
)

Functions

func Binarize

func Binarize(in, out *Matrix)

func Convolute

func Convolute(k Kernel, in, out *Matrix)

func DeferredConvolution

func DeferredConvolution(k Kernel, in, out *Matrix) *sync.WaitGroup

func NewDirectionalKernel

func NewDirectionalKernel(gx, gy *Matrix) *directionalKernel

func NewFilteredDirectional

func NewFilteredDirectional(gx, gy *Matrix, offset int) *filteredDirectional

func NewKernelMatrixMul

func NewKernelMatrixMul(a, b *Matrix, offset int) *matrixMulKernel

func NewVarianceKernel

func NewVarianceKernel(directional *Matrix, offset int) *varianceKernel

func Normalize

func Normalize(in, out *Matrix)

func ParallelConvolution

func ParallelConvolution(k Kernel, in, out *Matrix) *sync.WaitGroup

func Skeletonize

func Skeletonize(in *Matrix)

Types

type Condition

type Condition interface {
	Holds(p0, p1, p2, p3, p4, p5, p6, p7 bool) bool
}

type ConditionBottomBorder

type ConditionBottomBorder int

func (*ConditionBottomBorder) Holds

func (c *ConditionBottomBorder) Holds(p0, p1, p2, p3, p4, p5, p6, p7 bool) bool

type ConditionLeftBorder

type ConditionLeftBorder int

func (*ConditionLeftBorder) Holds

func (c *ConditionLeftBorder) Holds(p0, p1, p2, p3, p4, p5, p6, p7 bool) bool

type ConditionRightBorder

type ConditionRightBorder int

func (*ConditionRightBorder) Holds

func (c *ConditionRightBorder) Holds(p0, p1, p2, p3, p4, p5, p6, p7 bool) bool

type ConditionTopBorder

type ConditionTopBorder int

func (*ConditionTopBorder) Holds

func (c *ConditionTopBorder) Holds(p0, p1, p2, p3, p4, p5, p6, p7 bool) bool

type Kernel

type Kernel interface {
	Apply(in *Matrix, x, y int) float64
	Offset() int
}

type Matrix

type Matrix struct {
	// contains filtered or unexported fields
}

func BinarizeEnhancement

func BinarizeEnhancement(in *Matrix) *Matrix

func NewMatrix

func NewMatrix(bounds image.Rectangle) *Matrix

func NewMatrixFromGray

func NewMatrixFromGray(in *image.Gray) *Matrix

func (*Matrix) At

func (m *Matrix) At(x, y int) float64

func (*Matrix) Bounds

func (m *Matrix) Bounds() image.Rectangle

func (*Matrix) Set

func (m *Matrix) Set(x, y int, value float64)

func (*Matrix) SubImage

func (m *Matrix) SubImage(r image.Rectangle) *Matrix

func (*Matrix) ToGray

func (m *Matrix) ToGray() *image.Gray

type Sqrt

type Sqrt struct {
	// contains filtered or unexported fields
}

func NewSqrtKernel

func NewSqrtKernel(a, b *Matrix) *Sqrt

func (*Sqrt) Apply

func (k *Sqrt) Apply(_ *Matrix, x, y int) float64

func (*Sqrt) Offset

func (k *Sqrt) Offset() int

Jump to

Keyboard shortcuts

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