C
C#2y ago
pkp24

❔ Using IronOCR and noticed an issue

I've uploaded all of the images I've tried to read and it has failed to read every single one of them. Does anyone know how I might fix this, or another simple OCR?
12 Replies
pkp24
pkp24OP2y ago
It seems to fail only for 5053 or 50530 or some other variation of that. I've had this code running for about an hour in total and those are the only things it fails on.
Buddy
Buddy2y ago
Use another model? I don't know what to say here
pkp24
pkp24OP2y ago
Do you know of another simple yet good model? I tried using normal Tesseract to no avail
Buddy
Buddy2y ago
Those still require models afaik
pkp24
pkp24OP2y ago
I'm not certain I'm able to change the model used by ironocr, I'm using whatever came with it
Buddy
Buddy2y ago
Code example can be useful too $paste
MODiX
MODiX2y ago
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
pkp24
pkp24OP2y ago
string Result = "";
var ocr = new IronTesseract();

// Crop the bitmap to the specified rect
var croppedBitmap = bitmap.Clone(rect, bitmap.PixelFormat);
using (MemoryStream ms = new MemoryStream())
{
croppedBitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
AnyBitmap test = new AnyBitmap(ms);
Result = ocr.Read(test).Text;
}
string Result = "";
var ocr = new IronTesseract();

// Crop the bitmap to the specified rect
var croppedBitmap = bitmap.Clone(rect, bitmap.PixelFormat);
using (MemoryStream ms = new MemoryStream())
{
croppedBitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
AnyBitmap test = new AnyBitmap(ms);
Result = ocr.Read(test).Text;
}
Buddy
Buddy2y ago
Try setting the language to English (or whatever language it is) ? catshrug just numbers shouldn't be different I think, but worth a try maybe use the latest IronOCR version (or an older version if you're already on the latest)
pkp24
pkp24OP2y ago
It's default is english
reflectronic
reflectronic2y ago
is it OK if it only works on Windows hm, actually, the thing i'm thinking of doesn't seem to like those either
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server