Home : Barcodes : How can I recognize barcodes on a Fax image?
Q10120 - FAQ: How can I recognize barcodes on a Fax image?

Typicaly, fax images have a complex resolution (dpi.X != dpi.Y), which will make barcodes on the image seem distorted.  Our barcode reader requires that the image has dpi.X equal to dpi.Y.  The solution to this is to simply resample the image using the ratio of the dpi as the multiplying factor.  After the image is resampled, the Resolution property must be changd to match the new Dpi.  For example,

 [C#]

AtalaImage img = new AtalaImage(@"C:\FaxImage.TIF");
ImageCommand cmd = new ResampleCommand(new Size(img.Width, img.Height*(img.Resolution.X / img.Resolution.Y)));
AtalaImage newImg = cmd.ApplyToImage(img);
newImg.Resolution = new Dpi(img.Resolution.X,img.Resolution.X, img.Resolution.Units);
TiffEncoder enc = new TiffEncoder();
newImg.Save(@"C:\DataMatrix.tif",enc, null);

[VB.NET]

Dim img As AtalaImage = New AtalaImage("C:\FaxImage.TIF")
Dim cmd As ImageCommand = New ResampleCommand(New Size(img.Width, img.Height*(img.Resolution.X / img.Resolution.Y)))
Dim newImg As AtalaImage = cmd.ApplyToImage(img)
newImg.Resolution = New Dpi(img.Resolution.X,img.Resolution.X, img.Resolution.Units)
Dim enc As TiffEncoder = New TiffEncoder()
newImg.Save("C:\DataMatrix.tif",enc, Nothing)
Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2017. InstantASP Ltd. All Rights Reserved