astitesseract

package module
v0.0.0-...-8327e8c Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2017 License: MIT Imports: 3 Imported by: 0

README

This is a Golang library to manipulate tesseract-ocr.

Installation

Install tesseract-ocr

Linux

Run the following command:

$ apt-get install libtesseract-dev libleptonica-dev tesseract-ocr-eng

Then it's up to you languages you want to install.

Install go-astitesseract

Run the following command:

$ go get -u github.com/asticode/go-astitesseract/...

Use the library in your code

WARNING: the code below doesn't handle errors for readibility purposes. However you SHOULD!

t, _ := astitesseract.New(astitesseract.Options{Languages: []string{"eng"}})
defer t.Close()
fmt.Println(tst.GetUTF8Text("./testdata/test.png"))

will print

The (quick) [brown] {fox} jumps!
Over the $43,456.78 <lazy> #90 dog
& duck/goose, as 12.5% of E-mail
from aspammer@website.com is spam.
Der ,,schnelle” braune Fuchs springt
fiber den faulen Hund. Le renard brun
«rapide» saute par-dessus le chien
paresseux. La volpe marrone rapida
salta sopra i] cane pigro. El zorro
marrén répido salta sobre el perro
perezoso. A raposa marrom répida
salta sobre 0 C50 preguieoso.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	DataPath  string
	Languages []string
}

Options represents options

type Tesseract

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

Tesseract represents a Tesseract client

func New

func New(o Options) (t *Tesseract, err error)

New creates a new Tesseract based on options

func (*Tesseract) Close

func (t *Tesseract) Close() error

Close closes Tesseract properly

func (*Tesseract) GetUTF8Text

func (t *Tesseract) GetUTF8Text(path string) string

GetUTF8Text retrieves UTF8 text from an image path

Jump to

Keyboard shortcuts

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