dilippuri / PAN-Card-OCR

Retrive meaningful information from PAN Card image using tesseract-ocr :sunglasses:
MIT License
123 stars 60 forks source link

AttributeError: 'filter' object has no attribute 'split' #6

Open Alkeshm29 opened 6 years ago

Alkeshm29 commented 6 years ago

lines = text.split('\n') AttributeError: 'filter' object has no attribute 'split'

how to solve this error

dilippuri commented 6 years ago

What I had done there that If I grab text from image so it will return like paragraph now we have to process on each and every line of that paragraph so that's why I use "lines = text.split('\n')".

Alkeshm29 commented 6 years ago

I get none value

dilippuri commented 6 years ago

put 'print text' statement before "lines = text.split("\n")" and check what you get. Actually, I am assuming that information comes in different lines

shahnawaj5488 commented 6 years ago

I git cloned your project and ran in cmd E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src>C:\Python27\python.exe crop_morphology.py test.jpg

It gives error as too many values to unpack

shahnawaj5488 commented 6 years ago

Then I gave only path as the second argument and now there is no error but can't see any output, the src folder contains five test images

C:\Python27\Scripts>E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src\crop_morphology.py E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src

dilippuri commented 6 years ago

C:\Python27\Scripts>E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src\crop_morphology.py E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src\test.jpg

try this one and see

shahnawaj5488 commented 6 years ago

By giving this,

C:\Python27\Scripts>E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src\crop_morphology.py E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src\test.jpg Still E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src\test.jpg too many values to unpack

shahnawaj5488 commented 6 years ago

Brother can I get the step by step way to execute as this is an important project for me

dilippuri commented 6 years ago

let me know what do you wanna do?

there is no need to use crop_morphology.py in case you are extracting text from image

shahnawaj5488 commented 6 years ago

I want to get the name, DOB, pan number from pan card as a string. Similarly for the Driving License and Aadhaar card. Can you please share your email id at shahnawaj5488@rediffmail.com

shahnawaj5488 commented 6 years ago

Bro Please help with your email id at shahnawaj5488@rediffmail.com as tried a lot but things are not great.Need help asap.That would be great.

pritesh-tiwari commented 6 years ago

Hi Shahnawaz/Dilip,

I am working on same project, Could you please help me to execute this project.

dilippuri commented 6 years ago

I thought I need to work on it. The first thing is that modularization of the program. A complete change in logic and dependencies. Tackle the problem in a much better way.

@Alkeshm29 @shahnawaj5488 @pritesh-tiwari

Please help. What kinds of problems you got and how you tackle them? Suggestions would be appretiated.

vishalsahu215 commented 5 years ago

Hi Shahnawaz/Dilip,

I am working on same project, Could you please help me to execute this project, as I am facing the same issues as Shahnawaz faced, please help me out asap.

AmitKKhanchandani commented 5 years ago

any solution for this issue??

I am facing the same issue!

AmitKKhanchandani commented 5 years ago

I thought I need to work on it. The first thing is that modularization of the program. A complete change in logic and dependencies. Tackle the problem in a much better way.

@Alkeshm29 @shahnawaj5488 @pritesh-tiwari

Please help. What kinds of problems you got and how you tackle them? Suggestions would be appretiated.

@dilippuri can you share your approach on the logic, how you are gonna solve this? I am also stuck with the AttributeError: 'filter' object has no attribute 'split' and looking around the solution for this.

any help will be highly helpful on solving and building this project.

pcplws commented 4 years ago

@dilippuri Hi Dear, I need to read PAN CARD, ADHAR CARD AND VOTERID CARD and save this data in a csv file or database file. Please help me on this. I will be greatful to you. I am using your code but getting this error: Traceback (most recent call last): File "tpan.py", line 62, in lines = text.split('\n') AttributeError: 'filter' object has no attribute 'split'

Please help. I am in difficult situation.

antiksaini commented 2 years ago

add this line. it should work if using python3. text = list(filter(lambda x: ord(x) < 128, text)) text = ' '.join([str(s) for s in text])