Can't read blur images
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 15/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- computer-vision
Research direction
The reporter's code is in the issue body: a BarcodeReader with AutoRotate, TryHarder and TryInverted set, decoding a Bitmap built by ConvertBase64ToImage from Image.FromStream. The failing image is only linked externally, not in the repository, so first obtain it and reproduce the null result. Done means the sample decodes, or the maintainers explain which preprocessing it needs. The thread has been quiet for about 983 days with no assignee or pull request, so confirm with a maintainer before starting.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- C#
- Stars
- 3.1k
- Forks
- 704
- Avg merge
- 13d 17h
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from micjahn/ZXing.Net
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 3/5 Half a day Newbie friendliness 22/100
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
Difficulty 4/5 3-5 days Newbie friendliness 12/100
All issues in micjahn/ZXing.Net
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug 優先: 低
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
.NET area: storage bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Larson-Logan/medal-sync#61 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day