1. Component introduction
Required preceding component: None
Recommended succeeding component: Conditional Branch. You can use a branch condition to check if the OCR call is successful and design the subsequent flow.
You can use this component to recognize various types of tables in images using OCR (Example).
2. Inputs
For more information, see the help information for each input on the component panel in the ROS Visual Editor.
3. Outputs
For more information, see the help information for each output on the component panel in the ROS Visual Editor.
3.1. Key API return results
This output returns a dictionary that contains the key recognition results from the API. The keys and values in the dictionary are described in the following table:
key |
Key description |
Value data type |
content |
A summary of the text blocks recognized in the image. |
String |
3.2. Error message
This output returns the error code and error message as a string. For more information, see OCR Error Center.
https://next.api.aliyun.com/document/ocr-api/2021-07-07/errorCode
4. Component usage example
4.1. Component configuration example
For AI engine, select Alibaba Cloud OCR.
For Path of the image file to recognize, enter the path of the image file. The following figure shows an example.

Keep the default values for the advanced options.
4.2. Example execution result

5. Example flow
5.1. Setup flow
Use the Recognize tables with OCR component to specify the path of the image file to recognize.
Use the Conditional Branch component to determine whether the OCR call is successful. The branch condition is that v_recognize_table_success_1 equals the Boolean value True.
In the success branch, use the Get Value of Specified Key component to retrieve a specified key from the dictionary of key API return results.
Use the Record Log component to print the key recognition result.
In the failure branch, use the Record Log component to print the error message.
5.2. Execution result
As shown in the following figure, after the OCR call succeeds, the recognition result is printed to the log panel.
