-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
OCR Tesseract: "Warning: Invalid resolution 0 dpi. Using 70 instead." #881
Comments
I couldn't find a way to do it either. 😢 It might be possible to do that by rewriting the OpenCV implementation. tess.SetImage((uchar*)image.data, image.size().width, image.size().height, image.channels(), image.step1());
Pix* pix = tess.GetInputImage();
pixSetXRes(*pix, 70);
pixSetYRes(*pix, 70);
tess.Recognize(0);
... |
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. |
|
After update
|
Summary of your issue
When performing ocr on a captured screenshot, I get the warning "Warning: Invalid resolution 0 dpi. Using 70 instead.". I capture the screenshot as
System.Drawing.Bitmap
which does contain the correct dpi. When converting thebitmap
toOpenCvSharp.Mat
and then performing ocr on the mat it prints the warning into the console.Environment
Im using OpenCVSharp4 4.2.0.20200208
and OpenCVSharp4.runtime.win 4.2.0.20200208
Example code:
Output:
What did you intend to be?
Id like to either some how tell tesseract the dpi of the bitmap or mute the warning since 70 dpi is close enought to the actual dpi.
The text was updated successfully, but these errors were encountered: