2017-04-24 122 views
-1

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

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

只需添加您的API密钥,改变笔迹为真,并包括有手写的任何图片。

回答

1

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

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

问:多长时间手写识别操作走?

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