we have again a problem with barcoderecognition. The dll could find the datamatrix, but the codetext is not correct.
See attached pdf with the code.
codetext shoud be: 3-43867-AAS-001
codetext found with dll: (with linefeeds and other non printables characters): 98-43867-AAS-001
65|e
v
I tried it with aspose.barcode 5.8.0 and 5.7.0. I'm using RecognitionHints.ImageBinarization.MedianSmoothing, because with this, i got the best recognitation rate with my other documents.
Thank you for contacting support. I managed to replicate the incorrect recognition problem. I have logged this problem under ticket id BARCODENET-33737 in our issue tracking system. Your request has also been linked to this issue and you will be notified as soon as it is fixed. We’re sorry for your inconvenience.
As a workaround, you can try using PdfExtractor class. Because I tested your sample Pdf document against the latest builds of Aspose.BarCode 5.8.0.0 and Aspose.Pdf 8.5.0.0. Please try using the following source code:
// bind the pdf document
PdfExtractor pdfExtractor = new PdfExtractor();
pdfExtractor.BindPdf(PDFLocalfile);
Console.WriteLine("Extracting images.....");
pdfExtractor.ExtractImage();
int i = 0;
// save images to stream in a loop
while (pdfExtractor.HasNextImage())
{
Console.WriteLine("Getting next image....");
i++;
// save image to stream
MemoryStream imageStream = new MemoryStream();
pdfExtractor.GetNextImage(imageStream, ImageFormat.Png);
using (BarCodeReader barcodeReader = new BarCodeReader(imageStream, BarCodeReadType.DataMatrix))
{
barcodeReader.ImageBinarizationHints = RecognitionHints.ImageBinarization.MedianSmoothing;
while (barcodeReader.Read())
{
Console.WriteLine(i + " Codetext found: " + barcodeReader.GetCodeText() + ", Symbology: " + barcodeReader.GetReadType().ToString());
}
}
}
Hi Koehler. If you have more problematic documents and unrecognized barcodes, please share them. 5.9 should be released in two/three weeks (or even earlier) and we want to be sure it will solve all your problems.
it's not so easy to find problematic documents because in the production environment, those documents are deleted automatically (we do a simple regex-check of the codetext after conversion). And the strange thing is, that if those documents are printed and scanned again, they could mostly get decoded correctly...
The current bug (barcode found, but incorrect codetext decoded) is very difficult for us to handle. I thought, there is much errorcorrection inside datamatrix, so a code should be decoded correct or should not be found - but never should get an incorrect codetext. We did some tricks in our code to handle with not found codes (first run: resolution 150dpi, no noisereduction, if not found, second run with noisereduction on, third run resolution 300 dpi etc. (we are also doing loops with different settings of RecognitionHints.
Thank for sharing another problematic barcode image. I managed to replicate the problem incorrect recognition. I have logged this problem under ticket id BARCODENET-33747 in our issue tracking system. Your request has also been linked to this issue and you will be notified as soon as it is fixed. We’re sorry for your inconvenience.
Thank you for sharing problematic Pdf file. I managed to replicate the problem of incorrect recognition. I have logged this problem under ticket id BARCODENET-33749 in our issue tracking system. Your request has also been linked to this issue and you will be notified as soon as it is fixed. We’re sorry for your inconvenience.
We have a good news for you is BARCODENET-33747 and BARCODENET-33749 have now been resolved and their fix will be included in the next version of Aspose.BarCode for .NET 6.0.0. It is expected at the start of the next month. We will inform you via this forum thread as soon as the new release is published.
I have another problematic document with incorrect codetext. Can you please check it with the upcoming release? With the current release, i get an incorrect codetext.
Thank you for sharing problematic Pdf file. I managed to replicate the problem of incorrect recognition. I have logged this problem under ticket id BARCODENET-33763 in our issue tracking system. Furthermore, I have good news in advance that the latest code base of Aspose.BarCode can recognize a correct code text (“3-20835-AAS-001”) so far its fix will be included in the next version of Aspose.BarCode for .NET 6.0.0. Your request has also been linked to this issue and you will be notified as soon as the new release is published. We’re sorry for your inconvenience.