Problems with QR-Code Recognition

Discussions about barcode reading and writing
Post Reply
DavideBak
Posts: 11
Joined: Fri Aug 10, 2012 12:05 pm

Problems with QR-Code Recognition

Post by DavideBak » Tue Sep 18, 2012 9:55 am

Hello, I've some problems with QR-Code Barcode Recognition Plugin.

This is my PDF that contains 4 barcodes and this is my code that read barcodes.
In same case GDPicture recognizes 3 barcode (the 4th is too small but this is not my problem) and in others it recognizes 0 barcodes.

Code: Select all

GdPicturePDF gdPicPdf = new GdPicturePDF();
gdPicPdf.SetLicenseNumber(BarcodeResource.SERIAL_GDPICTURE);

Document doc = new Document();

if (File.Exists(fileSource))
{
	if (gdPicPdf.LoadFromFile(fileSource, false) == GdPictureStatus.OK)
	{
		for (int iPage = 1; iPage <= gdPicPdf.GetPageCount(); iPage++)
		{
			Page pg = new Page();
			
			gdPicPdf.SelectPage(iPage);
			imageId = gdPicPdf.RenderPageToGdPictureImage(dpi, false);

			if (imageId != 0)
			{
				GdPictureImaging gdPicImage = new GdPictureImaging();
				gdPicImage.BarcodeQRReaderDoScan(imageId, BarcodeQRReaderScanMode.BestQuality);			
				gdPicImage.ReleaseGdPictureImage(imageId);

				for (int iBarcode = 1; iBarcode <= gdPicImage.BarcodeQRReaderGetBarcodeCount(); iBarcode++)
					pg.AddQRCode(new QRCode(gdPicImage.BarcodeQRReaderGetBarcodeValue(iBarcode)));
					
				doc.AddPage(pg);
					
				gdPicImage.BarcodeQRReaderClear();
                gdPicImage.Dispose();
			}
		}
	}
}

NOTE : Document, Page and QRCode are my custom Objects
It's a bug on my code?

Thank in advance,
Davide
Attachments
Report.rar
PDF that contains 4 QR code
(248.62 KiB) Downloaded 465 times

SamiKharma
Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

Re: Problems with QR-Code Recognition

Post by SamiKharma » Tue Sep 18, 2012 10:32 am

Hi,

I guess by "some cases" you mean under different dpi. Please run the barcode recognition demo, it will render the page to 200 dpi (least allowed for barcode recognition in GdPicture). It will recognize all three barcodes. The fourth carries some corrupted data.
I suggest you try to mimic the barcode recognition demo.

Best,
Sami

DavideBak
Posts: 11
Joined: Fri Aug 10, 2012 12:05 pm

Re: Problems with QR-Code Recognition

Post by DavideBak » Tue Sep 18, 2012 12:11 pm

No. Even if originally PDF is rendered with 200 dpi, or more, in some case (it's random) the recognition fails.

The fourth barcode has no corrupted data, but contains a string converted to base64.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest