1

我正在尝试使用 ZXing 来读取一维条码,并且希望无论方向如何都能够读取条码,因为我假设这个人可能没有在看图像。我注意到 ZXing 可以读取高达 45 度的条码。是否有理由不测试图像的两个方向,是否有可能做到这一点?

如果没有,有替代品可以吗?

4

1 回答 1

1

The reason is just that 99.9% of the time people scan a barcode in its natural orientation (or upside down). Scanning for vertical barcodes would usually just be a waste of time, when you could be getting on to another frame to scan. But it's easy to do, just add an extra chunk of code to rotate and re-scan the image.

@user117 it is not necessary to try all orientations. Any rotation for which a horizontal line still passes through the whole barcode works. You would only have to try additional rotations to cover cases beyond those, and it turns out that 4 would be the most that are needed to cover any orientation.

于 2013-05-23T02:33:15.677 回答