0
votes

I am trying to use Microsoft's Computer Vision API service to detect handwriting and convert it to a machine readable text. However, when I test this service on their website after providing my API key, it just returns the header 202 Accepted without returning any results. If I switch the paramere handwriting to false, it returns the header 200 but the results are not readable.

Here is where I am testing their service: https://westus.dev.cognitive.microsoft.com/docs/services/56f91f2d778daf23d8ec6739/operations/587f2c6a154055056008f200/console

Just add your API key, change handwriting to true and include any picture that has handwriting.

2
I am also getting the same error. Receiving 202 response. But no data.Nikhil

2 Answers

2
votes

Just follow the Operation-Location header returned in the 202 response.

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",
    ...

Input image:

handwriting sample

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

Question: How long does the handwriting recognition operation take?

Answer: The amount of time that it takes depends on the length of the text. For longer texts, it can take up to several seconds. Therefore, after the Recognize Handwritten Text operation completes, you may need to wait before you can retrieve the results using the Get Handwritten Text Operation Result operation.

0
votes

This API work only if the image has 100% handwritten text. If it has a mix of printed and handwritten text, it does not differentiate between them and output both even if you set mode=Handwritten (i.e., you want only handwritten text)