Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ArtotBin = func(w bool) func(<-chan [][]bool) <-chan []string { return u.GenChanFunc(func(in <-chan [][]bool, out chan<- []string) { for e := range in { out <- bin2art(e, w) } }) }
turning 2d binary matrix to string array. whether reverse color.
View Source
var BinotImg = func(threshold int) func(<-chan Img) <-chan [][]bool { return u.GenChanFunc(func(in <-chan Img, out chan<- [][]bool) { for im := range in { out <- img2bin(im, threshold) } }) }
turning image to 2d binary matrix. your threshold to adjust the binarization.
View Source
var Resize = func(scale float64) func(<-chan Img) <-chan Img { return u.GenChanFunc(func(in <-chan Img, out chan<- Img) { for i := range in { dx := int(math.Floor(scale * float64(i.Bounds().Dx()))) dy := int(math.Floor(scale * float64(i.Bounds().Dy()))) dst := image.NewRGBA(image.Rect(0, 0, dx, dy)) xdraw.NearestNeighbor.Scale(dst, dst.Rect, i, i.Bounds(), xdraw.Over, nil) out <- dst } }) }
resizing the image with scale value, it won't change the ratio. return a stream chan function.
View Source
var TurnGray = u.GenChanFunc(func(in <-chan Img, out chan<- Img) { for i := range in { dx, dy := i.Bounds().Dx(), i.Bounds().Dy() dst := image.NewGray(image.Rect(0, 0, dx, dy)) draw.Draw(dst, dst.Bounds(), i, i.Bounds().Min, draw.Src) out <- dst } })
turning gray.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.