Page 1 of 1

Unable to read faxed barcodes

Posted: Wed Aug 04, 2010 12:40 am
by Daniel.Dority
We have had a lot of success reading barcodes straight from the writer; however, now we are facing difficulty reading barcodes from fax machines. The DPI is set at the highest settings on the faxed copies yet the software is unable to find any barcodes. Not one was found on a .TIFF document that contained 7 pages, with one barcode on each page.

I've modified some of the settings the following with all different types of permutations but it didn't seem to help.

Code: Select all

m_reader.Settings.ScanDirection = Vintasoft.Barcode.ScanDirection.Angle45and135 | Vintasoft.Barcode.ScanDirection.BottomToTop | Vintasoft.Barcode.ScanDirection.LeftToRight | Vintasoft.Barcode.ScanDirection.RightToLeft | Vintasoft.Barcode.ScanDirection.TopToBottom;
m_reader.Settings.SearchDistortedDataMatrixBarcodes = true;
What else would I need to do to allow us to read barcodes using your software that have been scanned/faxed in? Using the same faxed images and barcode reading software on our mobile phones, we are able to read it without any problems so we know it still can be read.

I've sent your team some files through the support email.

Thanks

Re: Unable to read faxed barcodes

Posted: Wed Aug 04, 2010 8:46 am
by Yuri
Your image with datamatrix barcodes has many noise, so it's necessary 4 times scale the image down with smoothing to read this barcode:
Here is example code:

Code: Select all

static void DownscaleRead(string filename, int k)
{
// create image
Image image = Image.FromFile(filename);
// create downscale image
Image newImage = new Bitmap(image.Width / k, image.Height / k, PixelFormat.Format32bppPArgb);
using (Graphics g = Graphics.FromImage(newImage))
{
// using image smoothing
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
// draw downscale image
g.DrawImage(image, 0, 0, newImage.Width, newImage.Height);

}
// free image
image.Dispose();

// create reader
BarcodeReader reader = new BarcodeReader();
reader.Settings.ScanBarcodeTypes = BarcodeType.DataMatrix;
// read barcode
Console.WriteLine((reader.ReadBarcodes(newImage)[0]).Value);

// free dowscale image
newImage.Dispose();
}
For such barcodes we recommend to scale image down 4 times:
DownscaleRead(filename, 4);

Re: Unable to read faxed barcodes

Posted: Wed Aug 04, 2010 9:29 pm
by Daniel.Dority
Yuri,

Thanks for the response. I modified the code a bit to handle our use cases:

[*] Handle multiple paged tiff files
[*] Smaller barcodes (Our actual size was 3 by 3 -- Ones in the email were larger)

To handle the smaller barcodes I used smaller increments of 0.5 instead of four. Four made the image too small to read but the increments worked perfectly as the scanner was able to pick all of them up. I shall continue testing to ensure all of our use cases work.

Big THANKS!

Re: Unable to read faxed barcodes

Posted: Tue Aug 17, 2010 4:15 pm
by Yuri
Glad to see that the problem has been solved.

Have a nice day!