Shreeshrii / tessdata_shreetest

finetuned traineddata files for tesseract 4.0.0 for testing
156 stars 32 forks source link

Recognize both digit & alphabet when fine tune digits #11

Open duonghb53 opened 5 years ago

duonghb53 commented 5 years ago

Dear Shreeshrii, I try your guide to fine tune from data_best/eng.datatrained add number font Ocrb but when I get ocrb.datatrained to recognize it still get alphabet & digit. I don't know how to do same you create digit.datatrained. It only get digit. Please help me. Thank you.

Shreeshrii commented 5 years ago

Now you can also use the blacklist config to avoid alphabet.

tesseract input output --oem 1 --psm 6 -l eng-c tessedit_char_blacklist=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

duonghb53 commented 5 years ago

Dear Shreeshrii, I have any questions:

  1. Difference between when using to recognize only digits: tessedit_char_blacklist=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ & tessedit_char_whitelist=1234567890

  2. I use your file digit.datatrained using on Tool VietOCR and it only recognize digit(I haven't to do anything) but when using ocrb.datatrained then it recognize to digit & alphabet. I don't understand why. Please help. Many thank.

Shreeshrii commented 5 years ago

tessedit_char_blacklist=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

will ignore a-z and A-Z only. Punctuation, digits and any other characters in unicharset will be recognized.

tessedit_char_whitelist=1234567890

Only the digits 0-9 will be recognized.

digit.traineddata

was only trained on a limited characterset of 0-9

ocrb.traineddata

I will have to check, but it was trained for both Alphabet and digits in OCRB font for recognition of ID.

Please note that all these are proof of concept traineddata files for training. I have not used any of them.

duonghb53 commented 5 years ago

Dear Shreeshrii, I use file your tessdata for recognize: digit.datatrained image I don't understand about Tesseract. I training with new data ocrb font but result is not exactly. image Can you recommend help me? Many thanks.

Shreeshrii commented 5 years ago

You should get perfect results using eng.traineddata from tessdata_best.

Make sure your image is 300 dpi.

3324069222

tesseract 3324069222.png - 3324069222

duonghb53 commented 5 years ago

Dear Shreeshrii, I tried change image to 300 dpi and test. Result is better. But have some difference between I only change dpi to 300 and image both change dpi to 300 & white padding. (I use EngineMode = Ltsm, PageSegMode pageSegMode = PageSegMode.SingleBlock) I try recognize with tessdata_best/eng.traineddata & digits.traineddata (I download in https://github.com/Shreeshrii/tessdata_shreetest/blob/master/digits.traineddata) This is result. I see result is same. What do I need to improve accuracy? (Improve quality image, fine tune file datatrain or try recognize with other parameter.....) I don't know how. It often mistake: 5->6, 7->2, 9->2 Regards,

duonghb53 commented 5 years ago

Dear Shreeshrii, This is image I use and result: Test.zip Please view it. Regards,

Shreeshrii commented 5 years ago

Try suggestions in

https://groups.google.com/forum/?fromgroups#!searchin/tesseract-ocr/lorenzo%7Csort:date/tesseract-ocr/2uBsbG9XHzI/1Y9QoA37BQAJ

On Fri, Aug 30, 2019 at 8:53 AM duonghb53 notifications@github.com wrote:

Dear Shreeshrii, This is image I use and result: Test.zip https://github.com/Shreeshrii/tessdata_shreetest/files/3558152/Test.zip Please view it. Regards,

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Shreeshrii/tessdata_shreetest/issues/11?email_source=notifications&email_token=ABG37I3KVUS2YU5HY4EBTGTQHCHEXA5CNFSM4IPNQ6Y2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5QNUBY#issuecomment-526440967, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG37I4X3BGLW7UQZUWZVQTQHCHEXANCNFSM4IPNQ6YQ .

--


भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com

duonghb53 commented 5 years ago

Dear Shreeshrii, I'm trying recognize(using databest/eng) digits but it often mistake digit 1 with '|, \, /, ]' because my font & image is skew. My idea is find this font and tune up from databest/eng. Is is good? Do you suggest me to solve it? Thanks. image

Shreeshrii commented 5 years ago

@nguyenq Quan Is it possible to use digits config file with VietOCR?

nguyenq commented 5 years ago

According to its readme file:

You can put init-only and non-init control parameters in tessdata/configs/tess_configs and tess_configvars files, respectively, to modify Tesseract's behaviour.

duonghb53 commented 5 years ago

@nguyenq I try config follow your guide but it still recognize to alphabet. Because I configs wrong? Please view attached file: image image

Shreeshrii commented 5 years ago

vietocr

I get the correct answer in Vietocr using a screenshot copy of your image. I am using the latest version I downloaded just now - vietocr 5.5.1

duonghb53 commented 5 years ago

Dear @Shreeshrii , Thank you. I try fine tune tessdata from your file: digits.traineddata. I can recognize easier and more accurate. But seem it regularly recognize mistake number 2 to number 3. Why is it happen? image

Shreeshrii commented 5 years ago

If your images are skewed, either deskew before feeding to tesseract or train on italic font matching your images.