Skip to content

OCR 与条码

OCR 模块支持异步导出任务和单图文本块提取;识别模块支持静态图片条码/二维码检测。

OCR 导出

json
{
  "request_id": "req-ocr-001",
  "method": "ocr.recognize",
  "params": {
    "input_upload_ids": ["img-..."],
    "format": "docx",
    "export_type": "multi-page",
    "output_path": "/tmp/output.docx",
    "languageType": "CHN_ENG"
  }
}

支持格式:txtpdfdocxxlsxofdjsonmulti-page 需要 output_pathsingle-page 需要 output_dir 或可推导出目录的 output_path

任务查询与取消:

json
{ "method": "ocr.get", "params": { "task_id": "ocr-..." } }
{ "method": "ocr.cancel", "params": { "task_id": "ocr-..." } }

文本块提取

json
{
  "request_id": "req-extract-001",
  "method": "ocr.extract_text",
  "params": {
    "input_upload_id": "img-..."
  }
}

返回 blocks[],包含 textxywidthheightconfidencefont_size

条码/二维码检测

json
{
  "request_id": "req-barcode-001",
  "method": "recognition.barcode_detect",
  "params": {
    "input_upload_id": "img-...",
    "formats": ["QR_CODE", "CODE_128"]
  }
}

formats 为空时由 provider 使用默认检测集合。返回 barcodes[],包含格式、文本和四点区域。

INFO

实时条码检测属于视频/采集流程的 provider 能力,不是公开 Command 方法。demo 中的实时条码示例数据只用于界面演示,不应作为接口调用。

CZUR Open Platform Documentation