Documentation
¶
Overview ¶
Package vision finds a picture on a screenshot and reads text with Tesseract. Both run on the PC; the phone only sends the screenshot.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrTooBig = errors.New("the image is larger than the screen") ErrFlat = errors.New("the image is a single flat color, so there is nothing to match") )
var ErrNoTesseract = errors.New("Tesseract is not installed")
ErrNoTesseract means OCR was asked for but Tesseract is not installed.
Functions ¶
Types ¶
type Line ¶
Line is one line of text Tesseract read, in screenshot pixels.
func FindText ¶
FindText returns the bounds of text: a word equal to it first, else a line that contains it.
type Match ¶
type Match struct {
Bounds [4]int // left, top, right, bottom
Score float64 // normalised cross-correlation, 1 is a perfect match
}
Match is where a template was found, in screenshot pixels.