Microsoft Computer Vision API手写

时间:2017-04-24 03:04:19

标签: api azure computer-vision orc

我正在尝试使用Microsoft的Computer Vision API服务来检测手写并将其转换为机器可读文本。但是,当我在提供API密钥后在其网站上测试此服务时,它只返回标题202 Accepted而不返回任何结果。如果我将参数手写切换为false,则返回标题200,但结果不可读。

这是我测试他们服务的地方: https://westus.dev.cognitive.microsoft.com/docs/services/56f91f2d778daf23d8ec6739/operations/587f2c6a154055056008f200/console

只需添加您的API密钥,将手写内容更改为true,并包含任何带有手写内容的图片。

2 个答案:

答案 0 :(得分:1)

只需按照Operation-Location回复中返回的202标题即可。

E.g。

$ curl https://westus.api.cognitive.microsoft.com/vision/v1.0/textOperations/2bd07b09-f7da-4028-aad1-afd239303722 \
       -H "Ocp-Apim-Subscription-Key: COMPUTER_VISION_API_KEY"
{
    "status": "Succeeded",
    "recognitionResult": {
        "lines": [
            {
                "boundingBox": [
                    0,
                    316,
                    276,
                    321,
                    275,
                    368,
                    0,
                    363
                ],
                "text": "unlikely on my terms.",
    ...
                "text": "writer My real dream is to live and work",
    ...
                "text": "to be a freelance illustrator or a freelance",
    ...

输入图片:

handwriting sample

来自https://docs.microsoft.com/en-us/azure/cognitive-services/computer-vision/faq

  

问题:手写识别操作需要多长时间?

     

答案:所需的时间取决于文本的长度。对于较长的文本,可能需要几秒钟。因此,在识别手写文本操作完成后,您可能需要等待才能使用“获取手写文本操作结果”操作检索结果。

答案 1 :(得分:0)

仅当图像具有100%手写文本时,此API才有效。如果混合使用打印文本和手写文本,则即使您设置mode =手写(即,您只希望手写文本),也不会区分两者并输出两者