-
-
Notifications
You must be signed in to change notification settings - Fork 667
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
Can't read blur images #463
Comments
I fear I can't help here. |
Hi @micjahn, I have attached my image(which is not detecting as PatchT). Could you help me on this blur type images how to decode it. Regards, |
It is a Code 39 containing PATCHT, It can be read with a Zebra TC52 Android device with a 2D Imager. I think it is a contrast issue, the black bars are too grey. |
And it is stupid having ornamental bars and spaces at the edges of a document containing a barcode. LOL! |
Since @micjahn said, there is nothing to be done to make this work in ZXing.Net, I'll allow myself to the new .NET wrapper of the zxing-cpp port that decodes both of the above images just fine. |
Hi @micjahn,
Unable to read the blurry type images using zxing.net dll and below is my code and blur image base64 data:
string scannedData = "Here I have base64 of the image";
Image image = ConvertBase64ToImage(scannedData);
Bitmap bitmap = (Bitmap)image;
BarcodeReader barcodeReader = new BarcodeReader{ AutoRotate = true };
barcodeReader.Options.TryHarder = true;
barcodeReader.Options.TryInverted = true;
Result barcodeResult = barcodeReader.Decode(bitmap);
if (barcodeResult != null)
{
Console.WriteLine("BarCode Result - BarCode Text is: " + barcodeResult.Text + " ; BarCode Format is: " + barcodeResult.BarcodeFormat.ToString());
}
else
{
Console.WriteLine("BarCode Result is null");
}
private static Image ConvertBase64ToImage(string base64string)
{
try
{
byte[] imageBytes = Convert.FromBase64String(base64string);
MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length);
//Convert byte[] to Image
ms.Write(imageBytes, 0, imageBytes.Length);
Image image = Image.FromStream(ms, true);
ms.Dispose();
return image;
}
catch (OutOfMemoryException ex)
{
Console.WriteLine($"Memory Out of Exception occured while converting base64 to Image and Message is : {ex.Message} & stack trace: {ex.StackTrace}");
return null;
}
catch (Exception ex)
{
Console.WriteLine($"Exception occured while converting base64 to Image and Message is : {ex.Message} & stack trace: {ex.StackTrace}");
return null;
}
}
Colud you help me on this how to Decode this type of images.
Thanks,
Rajesh
The text was updated successfully, but these errors were encountered: