Page 1 of 1

Rotate by barcode angle

Posted: Tue Aug 16, 2011 1:55 pm
by BenV
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.

Re: Rotate by barcode angle

Posted: Tue Aug 16, 2011 7:21 pm
by Loïc
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