Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Go package for OCR (Optical Character Recognition), by using Tesseract C++ library

License

NotificationsYou must be signed in to change notification settings

otiai10/gosseract

Repository files navigation

Build StatuscodecovGo Report CardGoDoc

Golang OCR package, by using Tesseract C++ library.

OCR Server

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

Example

package mainimport ("fmt""github.com/otiai10/gosseract")funcmain() {client:=gosseract.NewClient()deferclient.Close()client.SetImage("path/to/image.png")text,_:=client.Text()fmt.Println(text)// Hello, World!}

Install

  1. tesseract-ocr, including library and headers
  2. go get -t github.com/otiai10/gosseract

CheckDockerfile for more detail of installation, or you can just try bydocker run -it --rm otiai10/gosseract.

Test

In case you havetesseract-ocr on your local, you can just hit

% go test .

Otherwise, if youDON'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.

Issues


[8]ページ先頭

©2009-2025 Movatter.jp