Dicklesworthstone

LLM Aided OCR — AI skill for Claude Code

AI community

Enhances Tesseract OCR output using LLMs (local or API) for error correction, smart chunking, and markdown formatting of scanned PDFs.

How to install LLM Aided OCR

This entry records only its repository, not the path inside it, so there is no exact command to give. Open Dicklesworthstone/llm_aided_ocr and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What LLM Aided OCR does

Enhances Tesseract OCR output using LLMs (local or API) for error correction, smart chunking, and markdown formatting of scanned PDFs.

Alternatives in AI

  • Azure Vision Java — Image captioning, OCR, and object detection 1.8k ★
  • Semble Rs — Fast, AI-agent-native code search in Rust — hybrid BM25 + semantic, Tree-sitter AST chunking, dependency & imp 210 ★
  • AI Chat Exporter — Export your ChatGPT, Claude, Copilot, Gemini and Grok chat, using Tampermonkey on chrome, firefox, and other s 141 ★

README

LLM-Aided OCR Project

Introduction

The LLM-Aided OCR Project is an advanced system designed to significantly enhance the quality of Optical Character Recognition (OCR) output. By leveraging cutting-edge natural language processing techniques and large language models (LLMs), this project transforms raw OCR text into highly accurate, well-formatted, and readable documents.

Example Outputs

To see what the LLM-Aided OCR Project can do, check out these example outputs:

Features

  • PDF to image conversion
  • OCR using Tesseract
  • Advanced error correction using LLMs (local or API-based)
  • Smart text chunking for efficient processing
  • Markdown formatting option
  • Header and page number suppression (optional)
  • Quality assessment of the final output
  • Support for both local LLMs and cloud-based API providers (OpenAI, Anthropic)
  • Asynchronous processing for improved performance
  • Detailed logging for process tracking and debugging
  • GPU acceleration for local LLM inference

Detailed Technical Overview

PDF Processing and OCR

  1. **PDF to Image Conversion**

    • Function: convert_pdf_to_images()
    • Uses pdf2image library to convert PDF pages into images
    • Supports processing a subset of pages with max_pages and skip_first_n_pages parameters
  2. **OCR Processing**

    • Function: ocr_image()
    • Utilizes pytesseract for text extraction
    • Includes image preprocessing with preprocess_image() function:
      • Converts image to grayscale
      • Applies binary thresholding using Otsu's method