Rotate by barcode angle

Discussions about 1D barcode reading and writing
Post Reply
BenV
Posts: 21
Joined: Thu Dec 02, 2010 4:54 pm

Rotate by barcode angle

Post by BenV » Tue Aug 16, 2011 1:55 pm

Hi

My application scans documents that contain barcodes. Some documents are scanned skewed and I want to straighten them by the barcode angle.
I do something like this:

Code: Select all

.RotateAngle(intImageId, 360 - CSng(.Barcode1DReaderGetBarcodeSkewAngle(bcIndex)))
The rotation works but it's not straightened enough. It's either rotated too far or not far enough. I can't imaging this is normal. Is anyone familiar with the problem and perhaps knows a solution?

I'm using GdPicture v7.4.0.10.

User avatar
Loïc
Site Admin
Posts: 5592
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Rotate by barcode angle

Post by Loïc » Tue Aug 16, 2011 7:21 pm

Hi,

Your approach is very bad and can't be accurate. You are detecting skew angle of a very small portion of your image and extrapolate this rotation to the entire image. This means your barcode must be 100% clean, with no initial rotation and gets all its bar 100% detected by the engine. Also you lost precision with scaling factor operation.

In other words, this is not possible to get accurate autodeskew based only on barcode angle detection (else we already did that ;)). The Autodeskew method must be used in this case.

kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests