tesseract-ocr / tesseract-ocr/tesseract
Recognize result difference in "view debug mode" and in "API"
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 76.6k
- Forks
- 10.8k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 7
Description
Environment
-
Tesseract Version:
tesseract 4.0.0-beta.1-232-g45a6
leptonica-1.74.4
libjpeg 8d : libpng 1.2.50 : libtiff 4.0.8 : zlib 1.2.8 -
Platform:
Linux debian 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux
Current Behavior:
The result in view debug mode difference of my program that used libtesseract.
I run view debug mode use: tesseract input.jpg output -l chi_tra --psm 5 segmode inter
I was trained the chi_tra.traineddata my self, about used 46 types chinese fonts, the training text is chi_tra.training_text in langdata project.
even use tessdata_best/chi_tra.traineddata, the result also different.
For example:
-
input image

-
View debug mode output
tin this mode, i select a blob from image, the result is correct. ( "事" is the correct char)

-
part of source code in my program
api->SetPageSegMode(tesseract::PageSegMode::PSM_SINGLE_CHAR); // i corped a single char block from input image. api->SetImage(pix_char); api->SetSourceResolution(300); api->SetRectangle(0, 0, w, h); string ocr_result; if (api->Recognize(0) == 0) { ocr_result = (std::string) api->GetUTF8Text(); cout << ocr_result; }
in my own program, the result is "蟬", not only this char, most of char in my program was wrong
But, most of char in view debug mode is correct!!
So, I Dont know that's my fault or tesseract's bug.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the discrepancy with the supplied image, chi_tra.traineddata, and the tesseract ... --psm 5 segmode inter command. Compare that path with the program's SetPageSegMode(PSM_SINGLE_CHAR), SetImage, SetSourceResolution, SetRectangle, and Recognize calls. Done means identifying why the outputs differ and fixing or documenting the cause.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api, computer-vision
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100