Optical Character Recognition

Zia Optical Character Recognition electronically detects textual characters in images or digital documents, and converts them into machine-encoded text. Zia OCR can recognize text in nine international languages and 10 Indian languages. You can check the list of languages and language codes from the API documentation.

Note:Catalyst does not store any of the files you upload in its systems. The files you upload are used for one-time processing only. They are not used for ML model training purposes either. Catalyst components are fully compliant with all applicable data protection and privacy laws.

You must specify the path to the image or document file that needs to be processed for OCR as a parameter to the open() method. This opens the file and returns a file object as a response.

Allowed file formats: .jpg, .jpeg, .png, .tiff, .bmp, .pdf

File size limit: 20 MB

You must pass the file path, model type, and languages as arguments to the extract_optical_characters() method. However, the model type and language values are optional. By default, it is passed as the OCR model type, and the languages are automatically detected if they are not specified.

To know more about the component instance zia used below, please refer to this help section.

Parameters Used

Parameter Name Data Type Definition
img Image A Mandatory parameter. Will store the image that has to be analyzed.
language String A Mandatory parameter. Will store the language to be identified.
modelType String A Mandatory parameter. Will store the default value as "OCR".
    
copy
# OCR Implementation zia = app.zia() img = open("sample.webp", "rb") result = zia.extract_optical_characters(img, {"language": "eng", "modelType": "OCR"})

A sample response is shown below :

    
copy
{ "confidence":95, "text":"This is a lot of 12 point text to test the\nocr code and see if it works on all types\nof file format\n\nThe quick brown dog jumped over the\nlazy fox. The quick brown dog jumped\nover the lazy fox. The quick brown dog\njumped over the lazy fox. The quick\nbrown dog jumped over the lazy fox" }
Info : Refer to the SDK Scopes table to determine the required permission level for performing the above operation.

Last Updated 2025-03-28 18:24:49 +0530 +0530

ON THIS PAGE

RELATED LINKS

OCR - API SDK Scopes