Sending table for recognition

To extract a text from a scanned or photographed table, send a POST request to the https://api.aspose.cloud/v5.0/ocr/RecognizeTable Aspose.OCR Cloud REST API endpoint. To authorize the request, pass the access token in Authorization header (Bearer authentication).

The table image and recognition parameters are provided in JSON format in the request body.

{
  "image": "Base64 string",
  "settings": {
    "language": "English",
    "makeSkewCorrect": true,
    "rotate": 0,
    "makeBinarization": false,
    "makeContrastCorrection": true,
    "makeUpsampling": false,
    "makeSpellCheck": false,
    "dsrMode": "Regions",
    "dsrConfidence": "Default",
    "resultTypeTable": "Csv"
  }
}

Providing a table image

Scanned or photographed table is provided in a value of image property as a Base64 encoded string.

Recognition settings

Property Type Default value Description
language string English Specify a language for recognition.
makeSkewCorrect boolean true Automatically correct table image tilt (deskew) before proceeding to table recognition.
Automatic deskew works for images rotated 15 degrees or less. If the table is rotated by a larger degree or upside down, you must manually specify the rotation angle.
rotate integer 0 Rotate a table image by the specified degree.
Should be used when the table is rotated by a significant angle or turned upside down.
makeBinarization boolean false Automatically convert a table to black and white before proceeding to recognition.
makeContrastCorrection boolean true Automatically increase the contrast of a table image before proceeding to recognition.
makeUpsampling boolean false Intellectually upscale table image to improve small font recognition and detection of dense lines.
makeSpellCheck boolean false Automatically replace commonly misspelled words in recognition results with the correct ones. The dictionary is based on the selected recognition language.
dsrMode string Regions Document structure analysis algorithm.
dsrConfidence string Default Threshold for filtering content blocks detected by the selected structure analysis algorithm.
resultTypeTable string Text Recognition result format.

Image preprocessing order

If image preprocessing filters are enabled, they are applied one after the other in the following order:

  1. Contrast correction ("makeContrastCorrection": true)
  2. Skew correction ("makeSkewCorrect": true)
  3. Upsampling ("makeUpsampling": true)

If you want to apply preprocessing filters in another order, disable the corresponding recognition settings and use self-managed preprocessing.

Return value

If successful, this method returns a string with a unique identifier (GUID) of the table recognition request in the queue.

Otherwise, it returns a HTTP status code corresponding to the error.

What’s next

Recognition will take a few seconds, depending on the size of the table image and the current Aspose.Cloud load. See the article Fetching table recognition result for information on how to get a table recognition result from the server.

cURL example