gosseract

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

Github stars Tracking Chart

gosseract OCR

Build Status
codecov
Go Report Card
GoDoc

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 main

import (
	"fmt"
	"github.com/otiai10/gosseract"
)

func main() {
	client := gosseract.NewClient()
	defer client.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

Check Dockerfile for more detail of installation, or you can just try by docker run -it --rm otiai10/gosseract.

Test

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.

Issues

Main metrics

Overview
Name With Ownerotiai10/gosseract
Primary LanguageGo
Program languageGo (Language Count: 5)
Platform
License:MIT License
所有者活动
Created At2013-10-11 07:27:53
Pushed At2025-03-24 23:56:26
Last Commit At
Release Count11
Last Release Namev2.4.1 (Posted on )
First Release Namev2.0 (Posted on )
用户参与
Stargazers Count2.9k
Watchers Count51
Fork Count295
Commits Count524
Has Issues Enabled
Issues Count189
Issue Open Count30
Pull Requests Count108
Pull Requests Open Count3
Pull Requests Close Count26
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private