MCPcopy
hub / github.com/otiai10/gosseract

github.com/otiai10/gosseract @v2.4.1 sqlite

repository ↗ · DeepWiki ↗ · release v2.4.1 ↗
59 symbols 266 edges 8 files 35 documented · 59%
README

gosseract OCR

Go Test Docker Test Vagrant Test codecov Go Report Card Maintainability License: MIT Go Reference

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/v2"
)

func main() {
    client := gosseract.NewClient()
    defer client.Close()
    client.SetImage("path/to/image.png")
    text, _ := client.Text()
    fmt.Println(text)
    // Hello, World!
}

Installation

  1. tesseract-ocr, including library and headers
  2. 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.

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

Core symbols most depended-on inside this repo

Close
called by 24
client.go
NewClient
called by 22
client.go
SetImage
called by 21
client.go
Text
called by 14
client.go
SetWhitelist
called by 5
client.go
SetVariable
called by 5
client.go
init
called by 5
client.go
SetImageFromBytes
called by 4
client.go

Shape

Function 29
Method 20
Struct 7
TypeAlias 3

Languages

Go100%

Modules by API surface

client.go27 symbols
all_test.go16 symbols
hocr.go5 symbols
example_test.go4 symbols
benchmark_test.go4 symbols
constant.go3 symbols

Dependencies from manifests, versioned

github.com/otiai10/mintv1.6.3 · 1×

For agents

$ claude mcp add gosseract \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact