简体   繁体   English

ZXing Android Studio条码扫描器不适用于大条码

[英]ZXing Android Studio barcode scanner not working with large barcodes

I have developed an app for reading bar codes using the ZXing library, it works without problems with short codes such as: 我开发了一个使用ZXing库读取条形码的应用程序,它可以正常工作,而不会出现诸如以下短代码的问题:

Short Bar Code 短条码

在此处输入图片说明

but with long codes like the following, the program simply can not get any reading: 但是使用如下长代码,该程序根本无法读取任何内容:

Long Bar Code 长条码

在此处输入图片说明

Any ideas on how to solve this? 关于如何解决这个问题的任何想法? I need to read longer bar codes 我需要阅读更长的条形码

I don't think the problem lies with ZXing . 我认为问题不在于ZXing

As the barcode given in the question is a Code 128 format, which is supported by ZXing and the image attached in question is successfully scanned by ZXing Online Decoder and the output of scanned image is as: 由于问题中给出的条形码是Code 128格式,这是ZXing支持的,并且ZXing Online Decoder成功扫描了有问题的图像,扫描图像的输出为:

+--------------------+----------------------------+
| Raw text           | DSEC3743T0040001P96837678  |
+--------------------+----------------------------+
| Raw bytes          | 68 24 33 25 23 63 25 2b    |
|                    | 64 34 10 63 04 00 01 64    |
|                    | 30 63 60 53 4c 4e 54 6a    |
+--------------------+----------------------------+
| Barcode format     | CODE_128                   |
+--------------------+----------------------------+
| Parsed Result Type | TEXT                       |
+--------------------+----------------------------+
| Parsed Result      | DSEC3743T0040001P96837678  |
+--------------------+----------------------------+

The image is too long to be scanned properly by certain phone's camera, as ZXing receives callbacks from screen while camera is on so make sure barcode is properly focused and camera is not that shaky. 图片太长,无法用某些手机的相机正确扫描,因为ZXing在相机开启时会收到来自屏幕的回叫,因此请确保条形码正确聚焦并且相机不会晃动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM