Files
cutThink_lite/src-ocr-plugin/README.md
Claude e2ea309ee6 feat: CutThenThink v3.0 初始版本
完整实现 Tauri + Vanilla JS 轻量级截图工具

Phase 1 - 项目搭建
- Tauri 2.x 项目初始化
- Vite 前端项目搭建
- 基础 UI 框架(CSS 变量、组件库)
- 构建配置优化

Phase 2 - 核心截图功能
- 全屏/区域/窗口截图
- 截图预览和管理
- 文件命名和缩略图
- 全局快捷键集成

Phase 3 - 上传与存储
- 多图床上传(GitHub/Imgur/自定义)
- 配置管理系统
- SQLite 数据库

Phase 4 - OCR 集成
- 云端 OCR(百度/腾讯云)
- 插件管理系统
- 本地 OCR 插件(Go)
- OCR 结果处理

Phase 5 - AI 分类系统
- Claude/OpenAI API 集成
- Prompt 模板引擎
- 模板管理界面
- 自动分类流程

Phase 6 - 历史记录与管理
- 图库视图(网格/列表)
- 搜索与筛选
- 批量操作
- 导出功能(JSON/CSV/ZIP)

Phase 7 - 打包与发布
- 多平台构建配置
- CI/CD 工作流
- 图标和资源
- 安装包配置

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 18:59:26 +08:00

110 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CutThenThink OCR Plugin
本地 OCR 插件,基于 Tesseract OCR 引擎实现。
## 功能特性
- 支持多语言识别(中文、英文、日文、韩文等)
- 返回文本内容和边界框信息
- 提供置信度评分
- 跨平台支持Windows、macOS、Linux
## 系统依赖
### Linux (Ubuntu/Debian)
```bash
sudo apt-get install tesseract-ocr
sudo apt-get install tesseract-ocr-chi-sim # 简体中文
sudo apt-get install tesseract-ocr-chi-tra # 繁体中文
sudo apt-get install libtesseract-dev
```
### macOS
```bash
brew install tesseract
brew install tesseract-lang # 包含中文语言包
```
### Windows
1. 下载安装 Tesseract from [UB Mannheim](https://github.com/UB-Mannheim/tesseract/wiki)
2. 将 Tesseract 安装目录添加到 PATH 环境变量
3. 安装中文语言包
## 编译
```bash
# 下载依赖
go mod download
# 编译当前平台
go build -o ocr-plugin main.go
# 交叉编译
GOOS=windows GOARCH=amd64 go build -o ocr-plugin.exe main.go
GOOS=darwin GOARCH=amd64 go build -o ocr-plugin-mac main.go
GOOS=linux GOARCH=amd64 go build -o ocr-plugin-linux main.go
```
## 使用
### 查看版本
```bash
./ocr-plugin version
```
### 识别文本
```bash
./ocr-plugin recognize -image /path/to/image.png -lang eng+chi_sim
```
### 参数说明
- `-image`: 图片文件路径(必需)
- `-lang`: OCR 语言(默认: eng+chi_sim
#### 支持的语言代码
- `eng` - English
- `chi_sim` - 简体中文
- `chi_tra` - 繁体中文
- `jpn` - Japanese
- `kor` - Korean
## 输出格式
### 成功响应
```json
{
"success": true,
"engine": "tesseract",
"language": "eng+chi_sim",
"blocks": [
{
"text": "识别的文本",
"confidence": 95.5,
"bbox_x": 100,
"bbox_y": 200,
"bbox_width": 150,
"bbox_height": 30,
"block_type": "text"
}
]
}
```
### 错误响应
```json
{
"success": false,
"error": "错误信息"
}
```
## 性能优化
1. **图片预处理**: 在识别前对图片进行降噪、二值化处理可提高准确率
2. **语言选择**: 只加载需要的语言包可以提高速度
3. **图片尺寸**: 过大的图片会降低识别速度,建议缩放到合理尺寸
## 许可证
MIT License