360 Secure SkillHub
360 安全技能中心

Tesseract Ocr

该 Skill 使用本机 Tesseract OCR 命令行从图片中提取文字,支持中文、英文、日文等多种语言,可输出到终端或文本文件。需要预先安装 Tesseract 与相应语言包,不依赖 Python,适合本地 OCR 和图片文字识别。

whalefell
whalefell
热度 98.78
最近更新 2026-05-17 12:17:24
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add tesseract-ocr
Metadata
name
tesseract-ocr
description
Extract text from images using the Tesseract OCR engine directly via command line. Supports multiple languages including Chinese, English, and more. Use this skill when users need to extract text from images, recognize text content in images, or perform OCR tasks without Python dependencies.

Tesseract OCR Skill

Extract text content from images using the Tesseract engine directly via command line.

Features

  • Extract text from image files using native tesseract CLI
  • Support multi-language recognition (Chinese, English, etc.)
  • No Python dependencies required
  • Simple and fast

Dependencies

Install Tesseract OCR system package:

# Ubuntu/Debian:
sudo apt-get install tesseract-ocr tesseract-ocr-chi-sim

# macOS:
brew install tesseract tesseract-lang

Usage

Basic Usage

# Use default language (English)
tesseract /path/to/image.png stdout

# Specify language (Chinese + English)
tesseract /path/to/image.png stdout -l chi_sim+eng

# Save to file
tesseract /path/to/image.png output.txt -l chi_sim+eng

# Multiple languages
tesseract /path/to/image.png stdout -l chi_sim+eng+jpn

Common Language Codes

Language Code
Simplified Chinese chi_sim
Traditional Chinese chi_tra
English eng
Japanese jpn
Korean kor
Chinese + English chi_sim+eng

Quick Examples

# OCR with Chinese support
tesseract image.jpg stdout -l chi_sim

# OCR with mixed Chinese and English
tesseract image.png stdout -l chi_sim+eng

# Save to file instead of stdout
tesseract document.png result -l chi_sim+eng
# Creates result.txt

Notes

  1. OCR accuracy depends on image quality; use clear images for best results
  2. Complex layouts (tables, multi-column) may require post-processing
  3. Chinese recognition requires the tesseract-ocr-chi-sim language pack
  4. Language packs must be installed separately on your system