Install
openclaw skills install baidu-ocr百度 OCR 文字识别。支持中英文混合、公式、表格识别,准确率 95%+。使用百度 AI 开放平台 API。
openclaw skills install baidu-ocr使用百度 AI 开放平台进行高精度文字识别。
python3 {baseDir}/baidu_ocr.py /path/to/image.jpg
python3 {baseDir}/baidu_ocr.py <图片路径> [输出格式]
参数:
<图片路径>: 本地图片文件(jpg, png, bmp 等)[输出格式]: 可选,text(默认)或 json# 基础识别
python3 {baseDir}/baidu_ocr.py image.jpg
# JSON 格式输出
python3 {baseDir}/baidu_ocr.py image.jpg json
# 批量处理
for file in *.jpg; do
python3 {baseDir}/baidu_ocr.py "$file"
done
在 ~/.openclaw-env 中配置:
export BAIDU_API_KEY="your_api_key"
export BAIDU_SECRET_KEY="your_secret_key"
或者在 ~/.openclaw/openclaw.json 中配置:
{
skills: {
"baidu-ocr": {
apiKey: "YOUR_API_KEY",
secretKey: "YOUR_SECRET_KEY"
}
}
}
| 类型 | 说明 | API |
|---|---|---|
| 通用文字 | 中英文混合识别 | general_basic |
| 高精度 | 含位置信息 | general |
| 表格 | 表格结构识别 | table |
| 公式 | 数学公式识别 | formula |
| 错误码 | 说明 | 解决方法 |
|---|---|---|
| 110 | Access Token 无效 | 重新获取 Token |
| 111 | Access Token 过期 | 重新获取 Token |
| 216100 | 认证失败 | 检查 API Key |
| 216101 | 授权失败 | 检查 Secret Key |
版本:1.0.0 | 更新时间:2026-03-07