Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCRTesseract can not recognize Chinese #873

Closed
Sunzhuokai opened this issue Feb 27, 2020 · 7 comments
Closed

OCRTesseract can not recognize Chinese #873

Sunzhuokai opened this issue Feb 27, 2020 · 7 comments
Labels

Comments

@Sunzhuokai
Copy link

Summary of your issue

OCRTesseract can not recognize Chinese

Environment

image

What did you do when you faced the problem?

//write here

Example code:

using (var ocr = OCRTesseract.Create(“tessdata", "chi_sim"))
                        {
                            ocr.Run(topRoi, out text, out _componentRects, out  _componentTexts, out  _confidences);
                        }

Output:

Just 0-9,a-Z

What did you intend to be?

@shimat
Copy link
Owner

shimat commented Feb 27, 2020

Does your tessdata contain chi_sim.traineddata ?

@Sunzhuokai
Copy link
Author

Does your tessdata contain chi_sim.traineddata ?

yes
image

@Sunzhuokai
Copy link
Author

@shimat when i use https://github.com/charlesw/tesseract wrapper , it is works

@shimat
Copy link
Owner

shimat commented Feb 27, 2020

I could reproduce this problem. It may be an OpenCV bug.
opencv/opencv_contrib#2062

@stale
Copy link

stale bot commented Aug 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 25, 2020
@stale stale bot closed this as completed Sep 2, 2020
@Jerry-Gump
Copy link

Jerry-Gump commented Sep 9, 2021

I have the same problem,anything can fix it?

OK, maybe this is the reason: tesseract-ocr/tesseract#1250

@n0099
Copy link
Contributor

n0099 commented Mar 7, 2023

From https://docs.opencv.org/4.7.0/d7/ddc/classcv_1_1text_1_1OCRTesseract.html#a391b1e753f0b779b72204ec15200a99a:

char_whitelist specifies the list of characters used for recognition. NULL defaults to "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".

/// null defaults to "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".</param>

const auto result = cv::text::OCRTesseract::create(datapath, language, char_whitelist, oem, psmode);

so manually set the whitelist to empty string "" works for me.

n0099 added a commit to n0099/open-tbm that referenced this issue Mar 7, 2023
… be recognized by tesseract: shimat/opencvsharp#873 (comment) @ `TesseractRecognizer.ctor()`

@ crawler
n0099 added a commit to n0099/open-tbm that referenced this issue Mar 7, 2023
… be recognized by tesseract: shimat/opencvsharp#873 (comment) @ `TesseractRecognizer.ctor()`

- unused config `ImageOcrPipeline.PaddleOcr.ServingEndpoint` that deprecated since 541f4d2 @ appsettings.json
@ crawler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants