Ink Recognizer - Recognize

Ink Recognition operation is used to perform ink layout and recognition of written words and shapes. It allows passing the ink strokes to the service to get the recognition results in the response.

PUT https://{Endpoint}/inkrecognizer/v1.0-preview/recognize

URI Parameters

Name In Required Type Description
Endpoint
path True
  • string

Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).

Request Header

Name Required Type Description
x-ms-client-request-id
  • string

The request id used to uniquely identify each request during troubleshooting. This is an optional parameter useful for correlating logs and other artifacts.

Request Body

Name Required Type Description
applicationType

This describes the domain of the client application

language True
  • string

The IETF BCP 47 language code (for ex. en-US, en-GB, hi-IN etc.) of the expected language for the handwritten content in the ink strokes. The response will include results from this language.

strokes True

This is the array of strokes sent for recognition. Best results are produced when the order of strokes added in the array matches the order in which the user created them. Changing the stroke order may produce unexpected results.

unit enum:
  • mm
  • cm
  • in

This represents the physical units of the ink strokes. It is up to the application developer to decide how to convert the device specific units to physical units before calling the service. The conversion factor can be different based on the type of the device used.

unitMultiple
  • number

This is a scaling factor to be applied to the point coordinates when interpreting them in the physical units specified.

Responses

Name Type Description
200 OK

The results were processed successfully.

Other Status Codes

unexpected error

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

Identify a word written in ink

Sample Request

PUT https://{Endpoint}/inkrecognizer/v1.0-preview/recognize
{
  "language": "en-US",
  "strokes": [
    {
      "id": 1,
      "kind": "inkWriting",
      "points": "19.34498,28.21327,19.34498,27.93462,19.34498,27.65597,19.0157,27.65597,18.76874,27.44698,18.27483,27.44698,18.02787,27.44698,17.45164,27.44698,16.62845,27.65597,15.88758,27.93462,15.06439,28.49191,14.32351,28.97955,13.25337,29.53685,11.36003,31.41773,10.61916,32.46267,9.795967,33.50761,8.972776,34.83119,8.231905,35.87613,7.655672,37.19971,7.161757,38.24465,6.9148,39.35925,6.9148,40.12554,6.9148,40.89182,6.9148,41.72777,7.408715,42.2154,7.902629,42.49405,8.478863,42.77271,8.972776,43.05135,9.795967,43.05135,10.28988,43.05135,11.11307,42.77271,11.93626,42.2154,12.43018,41.72777,13.25337,41.17047,13.74728,40.12554,14.57047,39.0806,15.31134,37.75701,15.88758,36.15478,16.62845,34.27389,17.20468,32.46267,17.6986,30.30314,18.27483,28.21327,18.76874,26.12339,19.34498,23.96386,19.59193,21.87399,19.83889,19.9931,20.08585,18.46053,20.08585,17.13695,20.08585,16.02235,20.08585,14.97741,20.08585,14.48978,20.08585,13.93248,19.83889,13.65383,19.83889,13.65383,19.83889,13.65383,19.59193,13.65383,19.59193,13.         65383,19.34498,14.21113,19.34498,14.69876,19.0157,15.25606,19.0157,16.02235,18.76874,17.13695,18.76874,18.46053,18.52179,19.78412,18.27483,21.31669,18.02787,22.91892,18.02787,24.52116,17.6986,26.33238,17.45164,28.21327,17.20468,30.09415,16.95773,31.90537,16.62845,33.50761,16.62845,35.10984,16.62845,36.71207,16.62845,38.03566,16.95773,39.0806,17.20468,39.84688,17.45164,40.68283,18.02787,41.17047,18.52179,41.72777,19.34498,42.00642,19.83889,42.00642,20.90904,41.72777,21.73223,41.44912,22.4731,40.89182,23.54325,40.12554,24.36644,39.35925,25.10731,38.5233,25.9305,37.47836,26.75369,36.71207,27.24761,35.59748,27.49457,34.55254,27.74152,33.50761,28.0708,32.46267,28.0708,31.62672,28.0708,30.86044,28.0708,30.09415,27.74152,29.53685,27.49457,28.97955,27.24761,28.77056,26.75369,28.49191,26.42442,28.49191,25.9305,28.49191,25.43659,28.97955,25.10731,29.53685,24.6134,30.09415,24.03716,30.86044,23.79021,31.90537,23.29629,33.22896,23.04934,34.27389,22.72006,35.59748,22.72006,36.71207,22.4731,38.03566,22.72006,39.0806,22.72006,40.12554,23.04934,40.89182,23.29629,41.72777,23.79021,42.2154,24.36644,42.77271,24.86036,43.05135,25.68354,43.05135,26.42442,43.05135,27.24761,42.77271,28.31775,42.2154,29.3879,41.72777,30.45805,40.89182,31.44588,39.84688,32.8453,38.80195,33.83313,37.47836,35.15023,35.87613,36.22039,34.27389,37.29053,32.46267,39.43083,27.93462,40.50097,25.5661,41.24184,23.19757,41.81808,20.82905,42.55895,18.46053,42.88823,16.301,43.38214,14.48978,43.6291,11.84261,43.6291,10.72801,43.6291,10.24037,43.38214,9.96172,43.38214,9.96172,43.13519,9.96172,42.88823,10.72801,42.31199,12.60889,41.81808,14.21113,41.24184,16.02235,40.74793,18.18188,40.25402,20.5504,39.67778,23.19757,39.43083,25.84475,38.60764,31.13909,38.36068,33.78626,38.36068,36.43343,38.11372,38.80195,38.11372,40.89182,38.11372,43.05135,37.86677,45.14123,37.53749,48.62434,37.53749,49.94793,37.29053,51.27151,37.04358,52.31645,36.79662,53.08273,36.54966,53.64004,35.97342,53.84902,34.65633,53.64004,33.83313,53.08273,33.09226,52.5951,32.26907,51.75915,31.19892,50.71421,30.45805,49.66928,29.88182,48.83333,28.56471,47.02211,28.31775,46.18616,28.0708,45.69852,28.0708,45.14123,28.31775,44.37494,28.56471,43.53899,29.88182,42.2154,30.70501,41.44912,31.77516,40.68283,32.8453,39.56823,35.47952,37.75701,36.79662,36.92107,39.67778,35.38849,42.31199,34.0649,43.6291,33.50761,46.26331,32.74132,47.33346,32.46267,49.22679,32.18402,49.72071,31.90537,50.29694,31.90537,50.79086,31.90537,51.03782,31.90537,51.03782,31.90537,50.29694,31.90537,49.96766,32.18402,49.47375,32.46267,48.65057,32.74132,47.90969,33.22896,47.0865,33.78626,46.26331,34.27389,44.69925,35.87613,44.20533,36.71207,43.95837,37.75701,43.6291,38.5233,43.38214,39.84688,43.6291,40.12554,43.95837,40.40418,44.20533,40.68283,45.27548,40.40418,46.01635,40.12554,46.59258,39.56823,47.0865,38.80195,47.90969,38.03566,48.97984,36.15478,49.47375,35.10984,49.72071,34.27389,49.96766,33.50761,50.29694,32.46267,50.5439,31.90537,50.5439,31.90537,50.29694,32.18402,50.29694,32.74132,49.96766,33.22896,49.72071,34.83119,49.47375,35.87613,49.47375,37.75701,49.47375,38.5233,49.72071,39.0806,49.72071,39.35925,50.29694,39.56823,50.79086,39.56823,51.03782,39.35925,51.61405,38.80195,52.6842,37.47836,53.1781,36.71207,53.67202,35.87613,54.24826,35.10984,54.74217,34.55254,55.3184,33.50761,55.56536,33.22896,55.56536,32.95031,55.56536,32.95031,55.56536,33.78626,55.3184,34.27389,55.07145,35.38849,55.07145,36.15478,55.07145,36.92107,55.07145,37.47836,55.3184,38.03566,55.3184,38.24465,55.56536,38.5233,56.05928,38.5233,56.38855,38.24465,56.63551,38.03566,57.12943,37.75701,57.70565,36.71207,58.19957,36.15478,58.44653,35.10984,58.77581,34.55254,58.77581,34.27389,59.02276,34.0649,59.02276,33.78626,59.02276,33.78626,58.77581,34.27389,58.77581,34.55254,58.77581,35.10984,58.77581,35.38849,58.44653,36.71207,58.77581,37.47836,58.77581,38.03566,59.02276,38.80195,59.51667,39.56823,60.09291,39.84688,60.58682,39.84688,61.08074,39.56823,61.90393,39.35925,63.46799,38.24465,64.53814,37.19971,65.60828,36.15478,66.67844,34.55254,68.48946,31.41773,69.31265,29.53685,70.62975,25.5661,71.20598,23.47622,71.45294,21.87399,71.6999,20.5504,71.6999,18.18188,71.45294,17.34593,70.8767,16.57965,70.62975,16.301,70.3828,16.57965,69.88888,16.8583,68.81873,18.18188,68.24249,19.22682,67.17235,21.59534,66.43147,22.91892,65.85524,24.52116,65.60828,26.12339,64.7851,29.2582,64.53814,30.58179,64.29118,33.22896,64.53814,34.55254,64.53814,35.59748,64.7851,36.71207,65.85524,38.24465,66.43147,38.80195,67.99554,39.35925,68.81873,39.56823,69.5596,39.35925,70.62975,39.0806,73.01699,37.75701,74.33411,36.71207,76.72135,34.0649,78.03847,32.18402,79.35557,30.30314,80.67267,28.21327,82.81297,23.75487,83.88311,21.31669,85.20022,17.34593,85.69414,15.53471,86.02341,14.21113,86.27037,13.16619,86.27037,11.56396,86.27037,11.28531,86.27037,11.00666,86.02341,11.28531,86.02341,11.28531,86.02341,11.84261,85.44718,12.88754,85.44718,13.65383,84.95326,15.81336,84.70631,16.8583,84.37703,17.90323,83.88311,19.22682,83.30688,22.15264,82.81297,23.75487,81.98978,26.88968,81.49586,28.49191,81.00195,30.09415,80.67267,31.62672,80.17876,34.27389,79.9318,35.38849,79.60252,37.47836,79.60252,38.24465,79.60252,38.80195,79.9318,39.35925,80.42571,40.40418,81.00195,40.68283,82.31906,40.89182,83.05993,40.89182,83.88311,40.89182,84.95326,40.68283,86.76428,39.56823,87.58747,39.0806,89.15154,38.03566,89.72777,37.19971,90.22169,36.43343"
    },
    {
      "id": 2,
      "kind": "inkWriting",
      "points": "80.17876,20.27175,80.17876,20.27175,80.17876,20.27175,80.17876,20.27175,80.17876,20.5504,80.17876,20.5504,80.17876,20.5504,80.17876,20.5504,80.42571,20.5504,80.42571,20.5504,80.67267,20.5504,81.00195,20.5504,81.49586,20.5504,81.98978,20.5504,82.56602,20.5504,83.30688,20.5504,84.13007,20.5504,84.95326,20.27175,86.02341,20.27175,86.76428,20.27175,87.58747,20.27175,88.41067,19.9931,89.15154,19.9931,89.72777,19.9931,90.22169,19.78412,90.46864,19.78412,90.7156,19.78412,91.04487,19.78412,91.29183,19.78412,91.29183,19.78412,91.29183,19.78412,91.29183,19.78412,91.29183,19.78412,91.29183,19.78412,91.29183,19.78412,91.29183,19.78412,91.29183,19.78412,91.29183,19.78412,91.29183,19.78412,91.29183,19.78412,91.29183,19.78412,91.29183,19.78412,91.53879,19.78412,91.53879,19.78412,91.78574,19.78412"
    }
  ]
}

Sample Response

{
  "recognitionUnits": [
    {
      "alternates": [
        {
          "category": "inkWord",
          "recognizedString": "defaults"
        },
        {
          "category": "inkWord",
          "recognizedString": "defiant"
        },
        {
          "category": "inkWord",
          "recognizedString": "defaulter"
        },
        {
          "category": "inkWord",
          "recognizedString": "default's"
        },
        {
          "category": "inkWord",
          "recognizedString": "defaults'"
        },
        {
          "category": "inkWord",
          "recognizedString": "defaulted"
        },
        {
          "category": "inkWord",
          "recognizedString": "descant"
        },
        {
          "category": "inkWord",
          "recognizedString": "decant"
        },
        {
          "category": "inkWord",
          "recognizedString": "defat"
        }
      ],
      "boundingRectangle": {
        "height": 43.889999389648438,
        "topX": 6.9099998474121094,
        "topY": 9.9600000381469727,
        "width": 84.879997253417969
      },
      "category": "inkWord",
      "class": "leaf",
      "id": 4,
      "parentId": 3,
      "recognizedText": "default",
      "rotatedBoundingRectangle": [
        {
          "x": 3.1800000667572021,
          "y": 15.670000076293945
        },
        {
          "x": 89.419998168945312,
          "y": 3.3299999237060547
        },
        {
          "x": 95.430000305175781,
          "y": 45.330001831054688
        },
        {
          "x": 9.1899995803833,
          "y": 57.669998168945312
        }
      ],
      "strokeIds": [
        1,
        2
      ]
    },
    {
      "alternates": [
        {
          "category": "inkWord",
          "recognizedString": "defaults"
        },
        {
          "category": "inkWord",
          "recognizedString": "defiant"
        },
        {
          "category": "inkWord",
          "recognizedString": "defaulter"
        },
        {
          "category": "inkWord",
          "recognizedString": "default's"
        },
        {
          "category": "inkWord",
          "recognizedString": "defaults'"
        },
        {
          "category": "inkWord",
          "recognizedString": "defaulted"
        },
        {
          "category": "inkWord",
          "recognizedString": "descant"
        },
        {
          "category": "inkWord",
          "recognizedString": "decant"
        },
        {
          "category": "inkWord",
          "recognizedString": "defat"
        }
      ],
      "boundingRectangle": {
        "height": 43.889999389648438,
        "topX": 6.9099998474121094,
        "topY": 9.9600000381469727,
        "width": 84.879997253417969
      },
      "category": "line",
      "childIds": [
        4
      ],
      "class": "container",
      "id": 3,
      "parentId": 2,
      "recognizedText": "default",
      "rotatedBoundingRectangle": [
        {
          "x": 3.1800000667572021,
          "y": 15.670000076293945
        },
        {
          "x": 89.419998168945312,
          "y": 3.3299999237060547
        },
        {
          "x": 95.430000305175781,
          "y": 45.330001831054688
        },
        {
          "x": 9.1899995803833,
          "y": 57.669998168945312
        }
      ],
      "strokeIds": [
        1,
        2
      ]
    },
    {
      "boundingRectangle": {
        "height": 43.889999389648438,
        "topX": 6.9099998474121094,
        "topY": 9.9600000381469727,
        "width": 84.879997253417969
      },
      "category": "paragraph",
      "childIds": [
        3
      ],
      "class": "container",
      "id": 2,
      "parentId": 1,
      "rotatedBoundingRectangle": [
        {
          "x": 3.1800000667572021,
          "y": 15.670000076293945
        },
        {
          "x": 89.419998168945312,
          "y": 3.3299999237060547
        },
        {
          "x": 95.430000305175781,
          "y": 45.330001831054688
        },
        {
          "x": 9.1899995803833,
          "y": 57.669998168945312
        }
      ],
      "strokeIds": [
        1,
        2
      ]
    },
    {
      "boundingRectangle": {
        "height": 43.889999389648438,
        "topX": 6.9099998474121094,
        "topY": 9.9600000381469727,
        "width": 84.879997253417969
      },
      "category": "writingRegion",
      "childIds": [
        2
      ],
      "class": "container",
      "id": 1,
      "parentId": 0,
      "rotatedBoundingRectangle": [
        {
          "x": 3.1800000667572021,
          "y": 15.670000076293945
        },
        {
          "x": 89.419998168945312,
          "y": 3.3299999237060547
        },
        {
          "x": 95.430000305175781,
          "y": 45.330001831054688
        },
        {
          "x": 9.1899995803833,
          "y": 57.669998168945312
        }
      ],
      "strokeIds": [
        1,
        2
      ]
    }
  ]
}

Definitions

alternatePattern

The list of alternates for the core recognition result. In case of handwriting related recognition units, this list includes other words that are close possibilities to the results provided as 'recognizedText'.

analysisRequest

This shows the expected contents of a request

analysisResponse

This shows the expected contents of a response from the service

application

This describes the domain of the client application

BoundingRectangle

The bounding rectangle of the recognized unit represented by the coordinates of the top left corner (x,y) along with width (w) and height (h) of the rectangle. Note that this rectangle is not rotated. So for rotated objects such as slanted handwriting, it will cover the entire object. The unit will be matched to the one specified in the original request (mm by default.)

category

The category of a recognition unit represents the type of content for that unit.

classPattern

The class represents the type of the recognition unit. A recognition unit can be a leaf node or a container node. Container nodes typically have leaf nodes as children.

Color

This shows the components of the color in rgba format

Details

This gives details of the reason(s) for the error

drawingAttributesPattern

The properties to use when rendering ink

errorModel
kind

This is an optional property which influences the decision about what the stroke kind is between inkWriting and inkDrawing. This property should be set ONLY if the type of user content is known ahead of time. Not setting this value implies the kind is not known ahead of time. Kind represents the type of content the stroke is a part of.

leaf

The category of recognition units that represent types that don't have children recognition units.

pointDetailsPattern

This holds all the properties of one point

rasterOp
recognitionUnit

The list of recognition units based on the analysis of the ink strokes.

shape

The category should be used to determines the field to read the recognition result. Recognized Object represents the shape that was recognized for the node with category as inkDrawing. For handwriting related nodes, recognizedText contains the actual recognition result.

stroke
tip

This specifies the tip to be used to draw a stroke

unit

This represents the physical units of the ink strokes. It is up to the application developer to decide how to convert the device specific units to physical units before calling the service. The conversion factor can be different based on the type of the device used.

alternatePattern

The list of alternates for the core recognition result. In case of handwriting related recognition units, this list includes other words that are close possibilities to the results provided as 'recognizedText'.

Name Type Description
category

The category of recognition units that represent types that don't have children recognition units.

confidence
  • number

A number between 0 and 1 which indicates the confidence level in the result

points

Array of point objects that represent points that are relevant to the type of recognition unit. For example, for leaf node of inkDrawing category that represents a triangle, points would include the x,y coordinates of the vertices of the recognized triangle. The points represent the coordinates of points used to create the perfectly drawn shape that is closest to the original input. They may not exactly match.

recognizedString
  • string

The recognized string from an inkWord or the name of a recognized shape in an inkDrawing object

rotationAngle
  • number

The angular orientation of an object relative to the horizontal axis

analysisRequest

This shows the expected contents of a request

Name Type Description
applicationType

This describes the domain of the client application

language
  • string

The IETF BCP 47 language code (for ex. en-US, en-GB, hi-IN etc.) of the expected language for the handwritten content in the ink strokes. The response will include results from this language.

strokes

This is the array of strokes sent for recognition. Best results are produced when the order of strokes added in the array matches the order in which the user created them. Changing the stroke order may produce unexpected results.

unit enum:
  • cm
  • in
  • mm

This represents the physical units of the ink strokes. It is up to the application developer to decide how to convert the device specific units to physical units before calling the service. The conversion factor can be different based on the type of the device used.

unitMultiple
  • number

This is a scaling factor to be applied to the point coordinates when interpreting them in the physical units specified.

analysisResponse

This shows the expected contents of a response from the service

Name Type Description
language
  • string

This is the language used for recognizing handwriting from the ink strokes in the request. Set this to the user’s preferred language.

recognitionUnits

The list of recognition units based on the analysis of the ink strokes.

unit

This represents the physical units of the ink strokes. It is up to the application developer to decide how to convert the device specific units to physical units before calling the service. The conversion factor can be different based on the type of the device used.

unitMultiple
  • number

This is a scaling factor to be applied to the point coordinates when interpreting them in the physical units specified.

application

This describes the domain of the client application

Name Type Description
drawing
  • string
mixed
  • string
writing
  • string

BoundingRectangle

The bounding rectangle of the recognized unit represented by the coordinates of the top left corner (x,y) along with width (w) and height (h) of the rectangle. Note that this rectangle is not rotated. So for rotated objects such as slanted handwriting, it will cover the entire object. The unit will be matched to the one specified in the original request (mm by default.)

Name Type Description
height
  • number

The represents the height of the bounding rectangle

topX
  • number

This represents the top left x coordinate

topY
  • number

This represents the top left y coordinate

width
  • number

This represents width of the bounding rectangle

category

The category of a recognition unit represents the type of content for that unit.

Name Type Description
inkBullet
  • string
inkDrawing
  • string
inkWord
  • string
line
  • string
listItem
  • string
paragraph
  • string
unknown
  • string
writingRegion
  • string

classPattern

The class represents the type of the recognition unit. A recognition unit can be a leaf node or a container node. Container nodes typically have leaf nodes as children.

Name Type Description
container
  • string
leaf
  • string

Color

This shows the components of the color in rgba format

Name Type Description
a
  • number

The alpha component of the color

b
  • number

The blue component of the color

g
  • number

The green component of the color

r
  • number

The red component of the color

Details

This gives details of the reason(s) for the error

Name Type Description
code
  • string

This represents the error code

message
  • string

This represents the error message

target
  • string

This represents the target of the error message

drawingAttributesPattern

The properties to use when rendering ink

Name Type Description
color

This shows the components of the color in rgba format

fitToCurve
  • boolean

This indicates whether Bezier smoothing is used to render the stroke

height
  • number

The height of the stylus used to draw the stroke

ignorePressure
  • boolean

This indicates whether the thickness of a rendered Stroke changes according the amount of pressure applied.

rasterOp
tip

This specifies the tip to be used to draw a stroke

width
  • number

The width of the stylus used to draw the stroke

errorModel

Name Type Description
code
  • string

This represents the error code

details

This gives details of the reason(s) for the error

message
  • string

This represents the error message

target
  • string

This represents the target of the error message

kind

This is an optional property which influences the decision about what the stroke kind is between inkWriting and inkDrawing. This property should be set ONLY if the type of user content is known ahead of time. Not setting this value implies the kind is not known ahead of time. Kind represents the type of content the stroke is a part of.

Name Type Description
inkDrawing
  • string
inkWriting
  • string

leaf

The category of recognition units that represent types that don't have children recognition units.

Name Type Description
inkBullet
  • string
inkDrawing
  • string
inkWord
  • string
unknown
  • string

pointDetailsPattern

This holds all the properties of one point

Name Type Description
x
  • number

This represents the x coordinate of the point

y
  • number

This represents the y coordinate of the point

rasterOp

Name Type Description
copyPen
  • string
maskPen
  • string
noOperation
  • string

recognitionUnit

The list of recognition units based on the analysis of the ink strokes.

Name Type Description
alternates

The list of alternates for the core recognition result. In case of handwriting related recognition units, this list includes other words that are close possibilities to the results provided as 'recognizedText'.

boundingRectangle

The bounding rectangle of the recognized unit represented by the coordinates of the top left corner (x,y) along with width (w) and height (h) of the rectangle. Note that this rectangle is not rotated. So for rotated objects such as slanted handwriting, it will cover the entire object. The unit will be matched to the one specified in the original request (mm by default.)

category

The category of a recognition unit represents the type of content for that unit.

center

The coordinates (x,y) of the center of the recognition unit.

childIds
  • integer[]

An array of integers representing the identifier of each child of the current recognition unit.

class

The class represents the type of the recognition unit. A recognition unit can be a leaf node or a container node. Container nodes typically have leaf nodes as children.

confidence
  • number

The class represents the type of the recognition unit. A recognition unit can be a leaf node or a container node. Container nodes typically have leaf nodes as children.

id
  • integer

The identifier of the recognition unit. This id is used to indicate parent/child relationship between different recognition units.

parentId
  • integer

The id of the parent node in the tree structure of the recognition results. parent = 0 indicates that there is no dedicated parent node for this unit.

points

Array of point objects that represent points that are relevant to the type of recognition unit. For example, for a leaf node of inkDrawing category that represents a triangle, points would include the x, y coordinates of the vertices of the recognized triangle. The points represent the coordinates used to create the perfectly drawn shape that is closest to the original input. They may not exactly match.

recognizedObject

The category should be used to determines the field to read the recognition result. Recognized Object represents the shape that was recognized for the node with category as inkDrawing. For handwriting related nodes, recognizedText contains the actual recognition result.

recognizedText
  • string

The string represents the text that was recognized. It can be an empty string if the recognizer cannot determine the text.

rotatedBoundingRectangle

This property provides the rotated bounding rectangle that covers the entire recognized object along the angle of rotation of the object. Note that this is NOT the same as rotating the boundingRectangle by the rotation angle.

rotationAngle
  • number

This represents the angle at which the unit is rotated in degrees with respect to the positive X axis.

strokeIds
  • integer[]

This is an array of integers representing the list of stroke Identifier integers from the input request body that belong to this recognition unit.

shape

The category should be used to determines the field to read the recognition result. Recognized Object represents the shape that was recognized for the node with category as inkDrawing. For handwriting related nodes, recognizedText contains the actual recognition result.

Name Type Description
blockArrow
  • string
circle
  • string
cloud
  • string
curve
  • string
diamond
  • string
drawing
  • string
ellipse
  • string
equilateralTriangle
  • string
heart
  • string
hexagon
  • string
isoscelesTriangle
  • string
line
  • string
parallelogram
  • string
pentagon
  • string
polyLine
  • string
quadrilateral
  • string
rectangle
  • string
rightTriangle
  • string
square
  • string
starCrossed
  • string
starSimple
  • string
trapezoid
  • string
triangle
  • string

stroke

Name Type Description
drawingAttributes

The properties to use when rendering ink

id
  • integer

This is treated as a unique identifier for each stroke within a request. If the id is repeated within the same request, the service will return an error.

kind

This is an optional property which influences the decision about what the stroke kind is between inkWriting and inkDrawing. This property should be set ONLY if the type of user content is known ahead of time. Not setting this value implies the kind is not known ahead of time. Kind represents the type of content the stroke is a part of.

language
  • string

The IETF BCP 47 language code (for ex. en-US, en-GB, hi-IN etc.) of the expected language for the handwritten content in this stroke. The response will include results from this language.

points
  • string

A string of comma separated floating point values that represent the x and y coordinates of points that are part of the stroke. (X1,Y1, X2,Y2…). It is recommended to have a precision of 8 digits after the decimal to obtain most accurate recognition results. The origin (0,0) of the canvas is assumed to be at the top left corner of the canvas

tip

This specifies the tip to be used to draw a stroke

Name Type Description
ellipse
  • string
rectangle
  • string

unit

This represents the physical units of the ink strokes. It is up to the application developer to decide how to convert the device specific units to physical units before calling the service. The conversion factor can be different based on the type of the device used.

Name Type Description
cm
  • string
in
  • string
mm
  • string