gali8 / Tesseract-OCR-iOS

Tesseract OCR iOS is a Framework for iOS7+, compiled also for armv7s and arm64.
http://www.nexor.it
MIT License
4.22k stars 949 forks source link

Tessearct is not recognising the text. #179

Closed nikitasatnalika closed 9 years ago

nikitasatnalika commented 9 years ago

i had been following this answer on github https://github.com/gali8/Tesseract-OCR-iOS/issues/153

I followed the lines of code mentioned there but unfortunately its not working for me....I would be grateful if you help me.

my codes are quite similar to the one mentioned though am sending my code and image

G8Tesseract *tesseract = [[G8Tesseract alloc] initWithLanguage:@"eng"]; tesseract.delegate = self; tesseract.image = [[UIImage imageNamed:@"text image.jpg"] g8_blackAndWhite]; tesseract.rect = CGRectMake(20, 20, 100, 100); // [tesseract setImage:[UIImage imageNamed:@"textImg.jpg"]]; [tesseract recognize]; NSLog(@"Text %@", [tesseract recognizedText]);

// TxtView.text = tesseract.recognizedText ;

The error I receive is

Error opening data file /Users/moumitadas/Library/Developer/CoreSimulator/Devices/22800DC7-151F-4FCD-A4D0-0037129C8DC0/data/Containers/Bundle/Application/F04EF35F-C3E3-4F21-934E-58C957F95503/pagephones.app/tessdata/eng.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory. Failed loading language 'eng' Tesseract couldn't load any languages!

text image

gali8 commented 9 years ago

https://github.com/gali8/Tesseract-OCR-iOS/wiki/Installation => Importing the tessdata folder

nikitasatnalika commented 9 years ago

i have imported the tessdata folder still giving the error. but i dont have the folder icon blue.

gali8 commented 9 years ago

"Note how the tessdata folder has a blue icon, indicating it was imported as a referenced folder instead of a symbolic group."

When you drag&drop the folder, select "SYMBOLIC GROUP" instead of "referenced folder".

nikitasatnalika commented 9 years ago

Thank you..it worked :)

roblav96 commented 8 years ago

@gali8

When you drag&drop the folder, select "SYMBOLIC GROUP" instead of "referenced folder".

But in the wiki:

NOTE: This library currently requires the tessdata folder to be linked as a referenced folder instead of a symbolic group https://github.com/gali8/Tesseract-OCR-iOS/wiki/Installation#importing-the-tessdata-folder

Which is correct with most recent cocoapod?

roblav96 commented 8 years ago

edit

the one in the wiki is correct. just got it working :D

ramanihiteshc commented 5 years ago

in image using style font image so not detect image to text so image normal font style then apply OCR !