image-ocr
Extract text content from images using Tesseract OCR via Python
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- image-ocr
- description
- Extract text content from images using Tesseract OCR via Python
03 SKILL.md 正文
Steps
- Enumerate image files once (e.g.,
Path(img_dir).iterdir()), filter by extension, and sort by filename. - Avoid expensive multi-pass OCR by default: run a single OCR pass per image using a receipt-friendly segmentation mode (typically
--psm 6), optionally with light preprocessing (grayscale + autocontrast + sharpen). - If you must improve recall, only escalate to additional OCR passes (other
--psmvalues / variants) when parsing fails for the specific field(s), not for every image. - For long batch runs, cache OCR outputs so later steps (parsing / Excel writing) don’t re-OCR:
- Build a
{filename: ocr_text}dict during the OCR phase. - Optionally write/read a JSON cache file (e.g.,
/app/workspace/ocr_cache.json) to resume without repeating OCR.
- Build a
- Return/store raw OCR text (per filename) for downstream parsing; keep filenames as the stable join key.
Expected Result
A deterministic, filename-keyed collection of OCR text produced in a single bounded pass (with optional targeted fallback), enabling later parsing/Excel export without re-running OCR.
04 同仓库更多 Skills
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms