# OCR Tesseract problem

**URL:** https://community.automationedge.com/t/ocr-tesseract-problem/3188
**Category:** Get Help & Discuss
**Created:** [April 23, 2021, 6:07am UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188 "2021-04-23T06:07:10Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Shubhamautomation](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/shubhamautomation/32/604_2.png) [@Shubhamautomation](https://community.automationedge.com/u/Shubhamautomation)
#### Post date: [April 23, 2021, 6:07am UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/1 "2021-04-23T06:07:10Z")

</div>

Hello,  
I am trying to read text from image using OCR tesseract but after running i am not getting any output in outputtext field. (See Snapshot)

I don’t how to use it ?  
Also please tell how to extract data (like PAN number from PAN card )

Thank You !

 ![ocr_problem](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/1X/5f5b2558f487d750f205dd6bf5e78f0a4d31e0d9.png)

---

<div class="post-metadata">

### Author: ![rajanimhanta](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@rajanimhanta](https://community.automationedge.com/u/rajanimhanta)
#### Post date: [April 23, 2021, 6:50am UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/2 "2021-04-23T06:50:51Z")

</div>

Hi Shubham,

You have to give the tessdata master folder path in the Data Folder path.  
below is link for tessdata master.  
link : [GitHub - tesseract-ocr/tessdata: Trained models with support for legacy and LSTM OCR engine](https://github.com/tesseract-ocr/tessdata)

---

<div class="post-metadata">

### Author: ![Shubhamautomation](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/shubhamautomation/32/604_2.png) [@Shubhamautomation](https://community.automationedge.com/u/Shubhamautomation)
#### Post date: [April 23, 2021, 10:20am UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/3 "2021-04-23T10:20:57Z")

</div>

I downloaded the zip file which was 230 mb.  
when I was extracting the zip using win RAR it displayed currupted.  
when i repaired it and and used in OCR tesseract steps , outputtext was blank

is there any other way to download the file?  
if you could give some steps will be more better .  
Thank you for hearing me

---

<div class="post-metadata">

### Author: ![rajanimhanta](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@rajanimhanta](https://community.automationedge.com/u/rajanimhanta)
#### Post date: [April 23, 2021, 1:32pm UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/4 "2021-04-23T13:32:26Z")

</div>

Can you put the attached jar in PS lib folder.[jai-imageio-core-1.4.0.jar](https://community.automationedge.com/uploads/short-url/zSeove3It558RbCBCATE6G65dZ5.jar) (613.3 KB)

---

<div class="post-metadata">

### Author: ![Shubhamautomation](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/shubhamautomation/32/604_2.png) [@Shubhamautomation](https://community.automationedge.com/u/Shubhamautomation)
#### Post date: [April 23, 2021, 6:40pm UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/5 "2021-04-23T18:40:40Z")

</div>

Again i downloaded the tesseract ZIP file using WIFI which was 650 mb and extracted.  
first tesseract data folder path applied(see snapshot)  
then I tried with one jpg file and one pdf file and run  
but no output in outputtext field

I also placed the jai-imageio-core.jar file in lib folder but same problem found

 ![ocr problem](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/1X/9968e4be66e25b6310c284417e619bf11dafa22a.png)

---

<div class="post-metadata">

### Author: ![fbaldin](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/fbaldin/32/99_2.png) [@fbaldin](https://community.automationedge.com/u/fbaldin)
#### Post date: [April 25, 2021, 12:14pm UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/6 "2021-04-25T12:14:26Z")

</div>

Please add a **Generate Rows** prior to the OCR Tesseract Step

---

<div class="post-metadata">

### Author: ![Shubhamautomation](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/shubhamautomation/32/604_2.png) [@Shubhamautomation](https://community.automationedge.com/u/Shubhamautomation)
#### Post date: [April 25, 2021, 3:16pm UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/7 "2021-04-25T15:16:11Z")

</div>

Yes , I added Generate row and it is able to extract data from image.

**1 More Question:**  
If I want to extract PAN number from PAN Card then how can I do this.  
using OCR i able to extract all data from scanned document  
But how to extract particular text from scanned document or image?

Can you help for this in step wise?

---

<div class="post-metadata">

### Author: ![vijaykumar.naikwade](https://avatars.discourse-cdn.com/v4/letter/v/f08c70/32.png) [@vijaykumar.naikwade](https://community.automationedge.com/u/vijaykumar.naikwade)
#### Post date: [April 28, 2021, 12:13pm UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/8 "2021-04-28T12:13:52Z")

</div>

Please use the following regular expression using ‘Regex Evaluation’ plugin step to extract PAN number from the OCRed text.  
^[A-Z]{5}[0-9]{4}[A-Z]{1}$

---

<div class="post-metadata">

### Author: ![Shubhamautomation](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/shubhamautomation/32/604_2.png) [@Shubhamautomation](https://community.automationedge.com/u/Shubhamautomation)
#### Post date: [April 28, 2021, 12:45pm UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/9 "2021-04-28T12:45:23Z")

</div>

I tried but it returns. N  
Means matvh not found

---

<div class="post-metadata">

### Author: ![vijaykumar.naikwade](https://avatars.discourse-cdn.com/v4/letter/v/f08c70/32.png) [@vijaykumar.naikwade](https://community.automationedge.com/u/vijaykumar.naikwade)
#### Post date: [April 28, 2021, 1:36pm UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/10 "2021-04-28T13:36:33Z")

</div>

![image](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/1X/b4ec939b77c62aeb7d46fce171121709de6490d3.png)

![image](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/1X/893e7c1605841c42e8614d8ba787540da6ee2e35.png)

---

<div class="post-metadata">

### Author: ![Shubhamautomation](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/shubhamautomation/32/604_2.png) [@Shubhamautomation](https://community.automationedge.com/u/Shubhamautomation)
#### Post date: [April 29, 2021, 4:36am UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/11 "2021-04-29T04:36:54Z")

</div>

Still Not working !  
if my input rows contains only PAN numbers then it works  
But as i am extracting text from PAN card which consist of multiple text.  
it is returning N.  
**Question** : Do regular expression return the matched Result into field? or simply match the pattern and return boolean value.

 ![ocr error](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/1X/8b298760d213596603eb84886f836323a636a486.png)

---

<div class="post-metadata">

### Author: ![Shubhamautomation](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/shubhamautomation/32/604_2.png) [@Shubhamautomation](https://community.automationedge.com/u/Shubhamautomation)
#### Post date: [April 29, 2021, 6:34am UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/12 "2021-04-29T06:34:22Z")

</div>

**The String that i am getting AFTER OCR is**

e

mmmm

Permanent Account Number Card

ABABB0000M

T/ Name

S ot i

WM AAAAAAAAA BBBBBBBBB

…

---

<div class="post-metadata">

### Author: ![fbaldin](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/fbaldin/32/99_2.png) [@fbaldin](https://community.automationedge.com/u/fbaldin)
#### Post date: [May 1, 2021, 12:49pm UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/13 "2021-05-01T12:49:37Z")

</div>

> [@vijaykumar.naikwade](#):
>
> \[1\]{5}[0-9]{4}[A-Z]{1}$

Try adding . \* like the picture… see if that works:

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/1X/573d5740c511802992c68cc775e73d19b86287f5.png)

* * *

1. A-Z

---

<div class="post-metadata">

### Author: ![Shubhamautomation](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/shubhamautomation/32/604_2.png) [@Shubhamautomation](https://community.automationedge.com/u/Shubhamautomation)
#### Post date: [May 2, 2021, 7:26am UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/14 "2021-05-02T07:26:35Z")

</div>

Yes it’s Working Fine Thank you!  
What I did? I removed **ALL the space** from string after extracting From PAN CARD to make to it **single line**.  
Now it working absolutely fine.

 ![pan number extracting](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/1X/b6d200e79e80eeace0fd2eba9ff089795f2f0939.png)

---

<div class="post-metadata">

### Author: ![Arun9047](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Arun9047](https://community.automationedge.com/u/Arun9047)
#### Post date: [November 11, 2021, 9:25am UTC](https://community.automationedge.com/t/ocr-tesseract-problem/3188/15 "2021-11-11T09:25:42Z")

</div>

Hello, i am also facing same issue… without generate rows plugin the OCR Plugin is working without output,

After adding generate rows plugin , OCR throwing error,

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/2X/2/28e73fc428ef74b9c003dd21eb5f83946a733572.jpeg)

Please kindly give some suggestions
