How to use OCR

In this section, we are going to see how we can use OCR. Suppose we have an image and we have to extract the text in it. In such a scenario, OCR becomes very handy.

In the following example, we are going to use a random Google image with some text in it, as follows:

To extract text from the previous image, perform the following steps:

  1. Open UiPath Studio and click on a Blank project. Give it a meaningful name. On the Designer panel, drag and drop a Flowchart activity.
  2. Next, drag and drop a Get OCR Text activity from the Activities panel and set it as the start node. Double-click on it and click on the Indicate on screen option. Choose the specific area from which you want to extract the text from the image. In our case, we are using an image that we have searched for on Google.

 

  1. Now, click on the Text property of the Get OCR Text activity. A window will pop up as shown in the following screenshot. Right-click inside the window and choose Create Variable. Give it a meaningful name, press Enter, and click on the OK button. A variable will be created with that name:
            
  1. Drag and drop the Message box activity. Connect it to the Get OCR with text activity. Double-click on the Message box activity and specify the variable name that you have created earlier in the expression box. (In our case, it is the result variable).

Press F5 to see the result.

Try to change the scale property of the OCR engine. It will give you better results in some cases.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.13.173