CIB DeepER API Documentation (EN)
API-Description
Plain Text Output
As an alternative, it is possible to receive the OCR result as plain text. For that, in addition to the image, a JSON-File with the key-value-pair {'output_format': 'plain_text'} has to be uploaded. The content-type must be 'application/json'. The naming of the field must be 'json'.
In Python, a client implementation looks like this:
import requests import json files = { 'file': ('image.png', open(r'\path\to\image.png', 'rb'), 'application/octet-stream'), 'json': (None, json.dumps({'output_format': 'plain_text'}), 'application/json') } response = requests.post('http://backend-ocr.cib.de/ocr/v4', files=files, auth=('<>', '< >')) json_response = response.json()
In this case, the response would be a JSON-Object with three keys:
- 'image': filename of the original image (String)
- 'text': This is the recognized text as one String. Line breaks are encoded as '\n'. Backslashes that appear in the original text are escaped through a second backslash.
- 'versions': Information about the used OCR Engine.
An example OCR Result with plain text output looks like this:
{ "image": "schaefer.png", "text": "Software Entwicklung\nMünchen", "versions": [ [ "CIB deepER", "2.9.0" ] ] }