An open API service indexing awesome lists of open source software.

https://github.com/wraient/gocr

Lightweight OCR app in Go to extract text from images in GUI using Tesseract.
https://github.com/wraient/gocr

golang image-recognition ocr

Last synced: 8 days ago
JSON representation

Lightweight OCR app in Go to extract text from images in GUI using Tesseract.

Awesome Lists containing this project

README

          

# GOCR

Gocr is a simple yet effective Optical Character Recognition (OCR) application built in Go. With GOCR, you can select an image file, extract text from it, and interact with the extracted text. The app lets you click on text boxes to copy specific pieces or view all the extracted text below the image. While not 100% accurate, it provides a user-friendly OCR experience.

## Demo

![image](https://github.com/user-attachments/assets/98c6aac4-da2f-4a53-8ca3-db2afeb6554c)

## Features
- Open an image file for OCR scanning.
- Extract text using Tesseract OCR.
- Click on specific text boxes to copy text to the clipboard.
- View all extracted text in a scrollable section below the image.
- Requires Tesseract OCR engine for operation.

## Requirements
1. [Tesseract OCR](https://github.com/tesseract-ocr/tesseract)
2. Gocr binary: Download the **latest release** from [Gocr Releases](https://github.com/Wraient/gocr/releases/latest).

## Installing and Setup

> **Note**: Gocr requires Tesseract to work. Installation instructions for Tesseract on various Linux distributions are included below.

### Linux

Arch Linux / Manjaro (AUR-based systems)

```bash
sudo pacman -S tesseract tesseract-data-eng
curl -Lo gocr https://github.com/Wraient/gocr/releases/latest/download/gocr
chmod +x gocr
sudo mv gocr /usr/bin/
```

Debian / Ubuntu (and derivatives)

```bash
sudo apt update
sudo apt install tesseract-ocr
curl -Lo gocr https://github.com/Wraient/gocr/releases/latest/download/gocr
chmod +x gocr
sudo mv gocr /usr/bin/
```

Fedora Installation

```bash
sudo dnf update
sudo dnf install tesseract
curl -Lo gocr https://github.com/Wraient/gocr/releases/latest/download/gocr
chmod +x gocr
sudo mv gocr /usr/bin/
```

openSUSE Installation

```bash
sudo zypper refresh
sudo zypper install tesseract
curl -Lo gocr https://github.com/Wraient/gocr/releases/latest/download/gocr
chmod +x gocr
sudo mv gocr /usr/bin/
```

Generic Linux Installation

```bash
sudo install tesseract
curl -Lo gocr https://github.com/Wraient/gocr/releases/latest/download/gocr
chmod +x gocr
sudo mv gocr /usr/bin/
```

## Usage

### Options

| Flag | Description |
|---------------------------|-------------------------------------------------------------------------|
| `-i [Image path]` | Returns extracted text from image in terminal |
| `-g [Image path]` | Opens gui with specified image |

## Uninstallation

To remove Gocr:

```bash
sudo rm /usr/bin/gocr
```