Skip to content

change the default value of param charWhitelist from null to "" for method OpenCvSharp.Text.OCRTesseract.Create()#1542

Closed
n0099 wants to merge 1 commit intoshimat:masterfrom
n0099:patch-1
Closed

change the default value of param charWhitelist from null to "" for method OpenCvSharp.Text.OCRTesseract.Create()#1542
n0099 wants to merge 1 commit intoshimat:masterfrom
n0099:patch-1

Conversation

@n0099
Copy link
Copy Markdown
Contributor

@n0099 n0099 commented Mar 8, 2023

this will prevent anyone who uses tesseract to recognize non-Latin characters struggle with #873 and probably #1364 in the future
fix #873

@shimat
Copy link
Copy Markdown
Owner

shimat commented Mar 8, 2023

https://github.com/opencv/opencv_contrib/blob/ed1873bc2c58f1c2dc94f98c816be0d39068995f/modules/text/include/opencv2/text/ocr.hpp#L166

const char* char_whitelist=NULL

I don't think this modification is a major problem, but it creates a difference in specifications from the original OpenCV.
Since OpenCvSharp has been made to have the same specifications as the original OpenCV (C++) as much as possible, this modification is unacceptable.

@n0099
Copy link
Copy Markdown
Contributor Author

n0099 commented Mar 9, 2023

I've tested another OpenCV wrapper library Emgu.CV.OCR.Tesseract, they don't have this null to [0-9a-zA-Z] fallback when not providing a whitelist.

#1541 (comment)

since OpenCvSharp has the highest priority to make the specification the same as the original OpenCV, this is still not an issue I should face.
Could you please submit an issue to opencv/opencv instead of here?

@shimat
Copy link
Copy Markdown
Owner

shimat commented Mar 9, 2023

I am not willing to conform to Emgu.CV. Sorry but I will close this PR.

@shimat shimat closed this Mar 9, 2023
@n0099
Copy link
Copy Markdown
Contributor Author

n0099 commented Apr 17, 2023

the same specifications as the original OpenCV (C++) as much as possible

Now the change to upstream has been merged: opencv/opencv_contrib#3462

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OCRTesseract can not recognize Chinese

2 participants