Golang OCR package, by using Tesseract C++ library.
Do 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!
👉 https://github.com/otiai10/ocrserver
package main
import (
"fmt"
"github.com/otiai10/gosseract/v2"
)
func main() {
client := gosseract.NewClient()
defer client.Close()
client.SetImage("path/to/image.png")
text, _ := client.Text()
fmt.Println(text)
// Hello, World!
}
- tesseract-ocr, including library and headers
go get -t github.com/otiai10/gosseract/v2
Please check this Dockerfile to get started step-by-step.
Or if you want the env instantly, you can just try by docker run -it --rm otiai10/gosseract
.
In case you have tesseract-ocr on your local, you can just hit
% go test .
Otherwise, 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.
% ./test/runtime --driver docker
% ./test/runtime --driver vagrant
Check ./test/runtimes for more information about runtime tests.