首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >计算机视觉REST格式

计算机视觉REST格式
EN

Stack Overflow用户
提问于 2018-06-27 10:08:48
回答 1查看 1.2K关注 0票数 1

我目前正在使用java中计算机视觉API的试用版,所以我从网站上获得了代码,并成功地获得了JSON。但是,我得到的JSON格式与Demo页面中显示的JSON格式有很大不同。

例如,我的Json响应:

“区域”:[{ "boundingBox":"21,16,304,451",“行”:[{ "boundingBox":"28,16,288,41",“单词”:{ "boundingBox":"28,16,288,41",“文本”:“无”} }

代码语言:javascript
复制
    Whereas the demo page is:

{“行”:[{ "boundingBox":122,122,401,85,404,229,143,233,

看一下边框格式,我们可以清楚地看到不同之处。

EN

回答 1

Stack Overflow用户

发布于 2018-06-27 14:35:44

您得到的响应是使用计算机视觉API的OCR作为示例状态的结果:

代码语言:javascript
复制
{
  "language": "en",
  "textAngle": -2.0000000000000338,
  "orientation": "Up",
  "regions": [
    {
      "boundingBox": "462,379,497,258",
      "lines": [
        {
          "boundingBox": "462,379,497,74",
          "words": [
            {
              "boundingBox": "462,379,41,73",
              "text": "A"
            },
            {
              "boundingBox": "523,379,153,73",
              "text": "GOAL"
            },
            {
              "boundingBox": "694,379,265,74",
              "text": "WITHOUT"
            }
          ]
        },
        {
          "boundingBox": "565,471,289,74",
          "words": [
            {
              "boundingBox": "565,471,41,73",
              "text": "A"
            },
            {
              "boundingBox": "626,471,150,73",
              "text": "PLAN"
            },
            {
              "boundingBox": "801,472,53,73",
              "text": "IS"
            }
          ]
        },
        {
          "boundingBox": "519,563,375,74",
          "words": [
            {
              "boundingBox": "519,563,149,74",
              "text": "JUST"
            },
            {
              "boundingBox": "683,564,41,72",
              "text": "A"
            },
            {
              "boundingBox": "741,564,153,73",
              "text": "WISH"
            }
          ]
        }
      ]
    }
  ]
}

虽然来自演示页面的响应是使用计算机视觉API的识别文本,然后是操作效果获得操作结果的结果,但示例声明:

代码语言:javascript
复制
{
  "status": "Succeeded",
  "recognitionResult": {
    "lines": [
      {
        "boundingBox": [
          202,
          618,
          2047,
          643,
          2046,
          840,
          200,
          813
        ],
        "text": "Our greatest glory is not",
        "words": [
          {
            "boundingBox": [
              204,
              627,
              481,
              628,
              481,
              830,
              204,
              829
            ],
            "text": "Our"
          },
          {
            "boundingBox": [
              519,
              628,
              1057,
              630,
              1057,
              832,
              518,
              830
            ],
           "text": "greatest"
          },
          {
            "boundingBox": [
              1114,
              630,
              1549,
              631,
              1548,
              833,
              1114,
              832
            ],
            "text": "glory"
          },
          {
            "boundingBox": [
              1586,
              631,
              1785,
              632,
              1784,
              834,
              1586,
              833
            ],
            "text": "is"
          },
          {
            "boundingBox": [
              1822,
              632,
              2115,
              633,
              2115,
              835,
              1822,
              834
            ],
            "text": "not"
          }
        ]
      },
      {
        "boundingBox": [
          420,
          1273,
          2954,
          1250,
          2958,
          1488,
          422,
          1511
        ],
        "text": "but in rising every time we fall",
        "words": [
          {
            "boundingBox": [
              423,
              1269,
              634,
              1268,
              635,
              1507,
              424,
              1508
            ],
            "text": "but"
          },
          {
            "boundingBox": [
              667,
              1268,
              808,
              1268,
              809,
              1506,
              668,
              1507
            ],
            "text": "in"
          },
          {
            "boundingBox": [
              874,
              1267,
              1289,
              1265,
              1290,
              1504,
              875,
              1506
            ],
            "text": "rising"
          },
          {
            "boundingBox": [
              1331,
              1265,
              1771,
              1263,
              1772,
              1502,
              1332,
              1504
            ],
            "text": "every"
          },
          {
            "boundingBox": [
              1812,
              1263,
              2178,
              1261,
              2179,
              1500,
              1813,
              1502
            ],
            "text": "time"
          },
          {
            "boundingBox": [
              2219,
              1261,
              2510,
              1260,
              2511,
              1498,
              2220,
              1500
            ],
            "text": "we"
          },
          {
            "boundingBox": [
              2551,
              1260,
              3016,
              1258,
              3017,
              1496,
              2552,
              1498
            ],
            "text": "fall"
          }
        ]
      },
      {
        "boundingBox": [
          1612,
          903,
          2744,
          935,
          2738,
          1139,
          1607,
          1107
        ],
        "text": "in never failing ,",
        "words": [
          {
            "boundingBox": [
              1611,
              934,
              1707,
              933,
              1708,
              1147,
              1613,
              1147
            ],
            "text": "in"
          },
          {
            "boundingBox": [
              1753,
              933,
              2132,
              930,
              2133,
              1144,
              1754,
              1146
            ],
            "text": "never"
          },
          {
            "boundingBox": [
              2162,
              930,
              2673,
              927,
              2674,
              1140,
              2164,
              1144
            ],
           "text": "failing"
          },
          {
            "boundingBox": [
              2703,
              926,
              2788,
              926,
              2790,
              1139,
              2705,
              1140
            ],
           "text": ","
          }
        ]
      }
    ]
  }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51060050

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档