I went through the documentation and ran with high/max quality, allow incorrect bar codes, etc., and it still cannot find any barcode that is of type code39.
It seems you are experiencing difficulties with recognizing Code39 barcodes using Aspose. Here are a few suggestions that might help you troubleshoot the issue:
Image Quality: You mentioned that the recognition only worked when the quality was set to excellent. This indicates that the barcode image may need to be of high quality for successful recognition. Ensure that the barcode is clear, well-lit, and not distorted.
Checksum Validation: If your Code39 barcode includes a checksum, you may want to adjust the checksum validation settings in your code. The Aspose library allows you to set the checksum validation to either default or on. This can be crucial for accurate recognition. For example, you can use the following code snippet to set the checksum validation:
using (BarCodeReader read = new BarCodeReader("path_to_your_image.png", DecodeType.Code39Extended))
{
read.BarcodeSettings.ChecksumValidation = ChecksumValidation.Default; // or ChecksumValidation.On
foreach (BarCodeResult result in read.ReadBarCodes())
{
Console.WriteLine($"CodeType: {result.CodeTypeName}");
Console.WriteLine($"CodeText: {result.CodeText}");
}
}
Testing with Different Settings: Experiment with different settings in the barcode reader, such as allowing incorrect barcodes or adjusting the recognition parameters. This can sometimes yield better results.
Image Format: Ensure that the image format you are using is supported and that the barcode is not too small or too large in the image.
If you continue to face issues, consider sharing the specific parameters you are using for recognition, as well as any error messages or unexpected results you are encountering. This information can help in diagnosing the problem further.
If you need more detailed examples or further assistance, feel free to ask!
After initial testing, I am able to reproduce the issue as you mentioned by using your barcode image. If I use DecodeType.AllSupportedTypes, incorrect barcode was detected. If I use DecodeType.Code39,no barcode was recognized even I specify maximum quality settings.
We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): BARCODENET-39311
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
We evaluated your issue in details. We think the problem is related to high binarized noise, which affect zebra detection algorithms. Light blur with image resizing to 0.5/0.5 or lower solves this problem. In this way images “code39_aom_cut_resized.png”, “code39_aom_resized.png” are recognized well with normal quality.
We think we can add resizing(decreasing) image with blur algorithms to “High Quality” or “BarcodeQuality.Low” for 1D barcodes. We hope to resolve the issue soon.
Once we resolve the issue or we have some other updates, we will let you know here.
When we suggest resizing the image down and applying a light blur to resolve the issue, these are actually not degrading the image (quality) for visual purposes but it will intentionally simplify the image to reduce noise that confuses the Aspose.BarCode detection engine. it’s actually optimizing the image for barcode detection (internally). Hope you understand now.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.