图片 OCR
POST
/ocr_image
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Body 参数application/json
image
string
图片路径或链接
示例
{
// http 图片
"image": "http://i0.hdslb.com/bfs/archive/c8fd97a40bf79f03e7b76cbc87236f612caef7b2.png"
// 本地图片
// "image": "file://d:\\1.jpg"
// base64图片
// "image": "base64://xxxxxx"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://localhost:3000/ocr_image' \
--header 'Content-Type: application/json' \
--data-raw '{
// http 图片
"image": "http://i0.hdslb.com/bfs/archive/c8fd97a40bf79f03e7b76cbc87236f612caef7b2.png"
// 本地图片
// "image": "file://d:\\1.jpg"
// base64图片
// "image": "base64://xxxxxx"
}'
返回响应
🟢200成功
application/json
Body
status
string
必需
retcode
integer
必需
data
object
必需
texts
array [object {3}]
必需
language
string
必需
message
string
必需
wording
string
必需
示例
{
"status": "ok",
"retcode": 0,
"data": {
"texts": [
{
"text": "Sssr",
"confidence": 1,
"coordinates": [
{
"x": 32,
"y": 20
},
{
"x": 185,
"y": 18
},
{
"x": 187,
"y": 89
},
{
"x": 34,
"y": 92
}
]
}
],
"language": ""
},
"message": "",
"wording": ""
}
修改于 2024-10-27 11:32:04