仅提取文字
适合只需要纯文本的场景,多行识别结果以换行符连接。
POST
/api/ocr/textcurl -X POST -F "image=@test.png" \ http://localhost:8080/api/ocr/text
响应示例
{"errcode":0,"text":"第一行\n第二行"}
快速提取图片中的文字与位置信息
查看文本、置信度和原始响应数据
两个接口都使用 multipart/form-data,并通过 image 字段上传图片。
适合只需要纯文本的场景,多行识别结果以换行符连接。
/api/ocr/textcurl -X POST -F "image=@test.png" \ http://localhost:8080/api/ocr/text
{"errcode":0,"text":"第一行\n第二行"}
返回图片尺寸、逐行文字、置信度、坐标和字符详情。
/api/ocrcurl -X POST -F "image=@test.png" \ http://localhost:8080/api/ocr
{"errcode":0,"width":1280,"height":720,
"ocr_response":[{"text":"识别文字","rate":0.99,
"left":10,"top":20,"right":200,"bottom":50}]}