• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..26-Oct-2021-

.dockerignoreH A D26-Oct-20216 11

.gitignoreH A D26-Oct-2021464 4131

CODE_OF_CONDUCT.mdH A D26-Oct-20213.1 KiB4728

DockerfileH A D26-Oct-20211.4 KiB3629

ISSUE_TEMPLATE.mdH A D26-Oct-2021522 4429

LICENSEH A D26-Oct-20211 KiB2217

README.mdH A D26-Oct-20212.3 KiB6444

client.goH A D26-Oct-202113.3 KiB433283

constant.goH A D26-Oct-20213.2 KiB7933

go.modH A D26-Oct-202188 63

go.sumH A D26-Oct-2021365 54

hocr.goH A D26-Oct-20211.2 KiB5032

tessbridge.cppH A D26-Oct-20217.2 KiB231190

tessbridge.hH A D26-Oct-20211 KiB4436

README.md

1# gosseract OCR
2<!-- [![Build Status](https://travis-ci.org/otiai10/gosseract.svg?branch=master)](https://travis-ci.org/otiai10/gosseract) -->
3[![Runtime Test](https://github.com/otiai10/gosseract/workflows/Runtime%20Test/badge.svg)](https://github.com/otiai10/gosseract/actions?query=workflow%3A%22Runtime+Test%22)
4[![codecov](https://codecov.io/gh/otiai10/gosseract/branch/master/graph/badge.svg)](https://codecov.io/gh/otiai10/gosseract)
5[![Go Report Card](https://goreportcard.com/badge/github.com/otiai10/gosseract)](https://goreportcard.com/report/github.com/otiai10/gosseract)
6[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/otiai10/gosseract/blob/master/LICENSE)
7[![Go Reference](https://pkg.go.dev/badge/github.com/otiai10/gosseract/v2.svg)](https://pkg.go.dev/github.com/otiai10/gosseract/v2)
8
9Golang OCR package, by using Tesseract C++ library.
10
11# OCR Server
12
13Do you just want OCR server, or see the working example of this package? Yes, there is already-made server application, which is seriously easy to deploy!
14
15�� https://github.com/otiai10/ocrserver
16
17# Example
18
19```go
20package main
21
22import (
23	"fmt"
24	"github.com/otiai10/gosseract/v2"
25)
26
27func main() {
28	client := gosseract.NewClient()
29	defer client.Close()
30	client.SetImage("path/to/image.png")
31	text, _ := client.Text()
32	fmt.Println(text)
33	// Hello, World!
34}
35```
36
37# Install
38
391. [tesseract-ocr](https://github.com/tesseract-ocr/tesseract/wiki), including library and headers
402. `go get -t github.com/otiai10/gosseract`
41
42Check [Dockerfile](https://github.com/otiai10/gosseract/blob/master/Dockerfile) for more detail of installation, or you can just try by `docker run -it --rm otiai10/gosseract`.
43
44# Test
45
46In case you have [tesseract-ocr](https://github.com/tesseract-ocr/tesseract/wiki) on your local, you can just hit
47
48```
49% go test .
50```
51
52Otherwise, if you **DON'T** want to install tesseract-ocr on your local, kick `./test/runtime` which is using Docker and Vagrant to test the source code on some runtimes.
53
54```
55% ./test/runtime --driver docker
56% ./test/runtime --driver vagrant
57```
58
59Check [./test/runtimes](https://github.com/otiai10/gosseract/tree/master/test/runtimes) for more information about runtime tests.
60
61# Issues
62
63- [https://github.com/otiai10/gosseract/issues](https://github.com/otiai10/gosseract/issues?utf8=%E2%9C%93&q=is%3Aissue)
64