azure - Azure Form Recognizer boundingBox 结果转换为 XY 坐标
问题描述
我想将表单识别器“boundingBox”的结果转换为图像坐标以可视化叠加图像和识别的数据。但是,boundingBox 结果看起来不像此图像这样的 XY 坐标位置。 https://i.stack.imgur.com/DOEi5.png
我需要每个boundingBox的左上(X1,Y1)和右下(X2,Y2)计算规则。
我还用认知服务 OCR 和文本识别制定了一些计算规则,但没有关于表单识别器的信息。我试图通过减号或除法找到 XY 坐标规则,但不是我得到的规则。
这是我通过表单识别器的示例图像获得的结果 json 数据。但无法从中找到 boundingBox 规则。
Responsebody: {
'status': 'success',
'pages': [
{
'number': 1,
'height': 792,
'width': 612,
'clusterId': 0,
'keyValuePairs': [
{
'key': [
{
'text': 'Address:',
'boundingBox': [
57.3,
683.0,
100.5,
683.0,
100.5,
673.7,
57.3,
673.7
]
}
],
'value': [
{
'text': '1020 Enterpirse Way.',
'boundingBox': [
57.3,
672.2,
153.1,
672.2,
153.1,
658.8,
57.3,
658.8
],
'confidence': 0.53
},
我需要每个boundingBox的左上(X1,Y1)和右下(X2,Y2)计算规则。
感谢团队。
解决方案
在示例中:
'boundingBox': [
57.3,
683.0,
100.5,
683.0,
100.5,
673.7,
57.3,
673.7
]
它表示边界框的顶点。
// Azure Bounding box: (57.3,683.0) X1,Y1---->x2,y2(100.5,683.0)
| |
| |
(57.3,673.7) X4,Y4<----x3,y3(100.5,673.7)
从上面的例子中,选择 (X1,y1) 和 (x3,y3) 来绘制边界框。边界框在 Azure 中是非常连续的,它从 x1、y1、x2、y2、x3、y3、x4、y4 开始。列表中的前两个值是 x1,y1,第 5,6 个是 x3,y3。
推荐阅读
- reactjs - html标记作为ckeditor4-react中的placeHolder
- android - github 操作颤振给出错误“工件模式:build/app/outputs/apk/release/*.apk 不匹配任何文件”
- button - 如何在清单中使用多个接收器媒体按钮
- python - Python中关于类和赋值的执行时间
- javascript - 使用 Expo 相机录制视频上传服务器使用 axios api 请求显示错误
- javascript - Bootstrap 行变体元素不会改变行颜色
- javascript - JS 脚本未按顺序下载和评估
- docker - 在 Docker 上运行的 Selenium Hub 的 Windows 身份验证
- docker - 来自 docker stats 命令的容器的实际 CPU 使用率是多少
- python - 所以有 CM_satisfaction 库包含不同的值,比如 Pandas 中的完全不满意、有些满意和完全满意