tessdata_shreetest icon indicating copy to clipboard operation
tessdata_shreetest copied to clipboard

Recognize both digit & alphabet when fine tune digits

Open duonghb53 opened this issue 6 years ago • 15 comments

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.

duonghb53 avatar Aug 26 '19 09:08 duonghb53

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

Shreeshrii avatar Aug 27 '19 08:08 Shreeshrii

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.

duonghb53 avatar Aug 28 '19 06:08 duonghb53

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.

Shreeshrii avatar Aug 28 '19 08:08 Shreeshrii

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.

duonghb53 avatar Aug 29 '19 10:08 duonghb53

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

Make sure your image is 300 dpi.

3324069222

tesseract 3324069222.png - 3324069222

Shreeshrii avatar Aug 29 '19 10:08 Shreeshrii

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 avatar Aug 30 '19 03:08 duonghb53

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

duonghb53 avatar Aug 30 '19 03:08 duonghb53

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 [email protected] 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

Shreeshrii avatar Aug 30 '19 08:08 Shreeshrii

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

duonghb53 avatar Sep 19 '19 02:09 duonghb53

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

Shreeshrii avatar Sep 19 '19 11:09 Shreeshrii

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.

nguyenq avatar Sep 19 '19 23:09 nguyenq

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

duonghb53 avatar Sep 20 '19 02:09 duonghb53

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

Shreeshrii avatar Sep 20 '19 13:09 Shreeshrii

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

duonghb53 avatar Sep 23 '19 03:09 duonghb53

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

Shreeshrii avatar Sep 23 '19 03:09 Shreeshrii