Zxing有时会从条形码中提取错误的数据 [英] Zxing sometimes picks up the wrong data from barcode

查看:68
本文介绍了Zxing有时会从条形码中提取错误的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这可能是一个非常简单的问题,我们还可以设置条形码格式以通过Zxing进行扫描,如下所示:

I know this might be rather a simple issue to ask for and we can also set the barcode format to be scanned by Zxing, like this:

(1)intent.putExtra("SCAN_MODE", "QR_CODE_MODE"); //or any other format

如果我们这样做:

(2)intent.putExtra("SCAN_MODE", "SCAN_MODE");//对于所有模式`

(2)intent.putExtra("SCAN_MODE", "SCAN_MODE"); //for all modes`

在执行此行上方提到的#2时,扫描程序有时似乎会扫描部分条形码并拾取错误的信息.例如,如果我尝试简单地扫描UPC条形码,则98%的时间都能正常工作,但有时它会返回错误的条形码.我想我知道这里发生了什么,我脑子里有了一个主意,但是对此的确切技术解释是什么? (熟悉条形码的任何人都可以提供帮助)谢谢大家.

While doing the #2 mentioned right above this line, the scanner sometimes seems to scan part of the barcode and picks up wrong information. For example if I try to simply scan a UPC barcode, 98% of the times it works beautifully, but sometimes it just returns me a wrong barcode. I think I know whats happening here, I have an idea up in my head, but what is the exact technical explanation for this? (Anyone familiar with barcodes can help) Thanks in advance guys.

推荐答案

SCAN_MODE不是有效值.它会被忽略,您正在扫描所有格式.

SCAN_MODE is not a valid value. It is ignored and you are scanning for all formats.

它没有从条形码中读取错误的信息;它会在所有这些黑白线之间找到另一种格式的幻像"条形码.常见的罪魁祸首是UPC-E,这是最容易意外看到的.

It is not reading the wrong information from a barcode; it is finding a 'phantom' barcode among all those white and black lines, of another format. The usual culprit is UPC-E, which is the easiest to accidentally see.

这就是为什么最好以正确的值SCAN_MODE将扫描限制为您感兴趣的格式.

This is why it is far better to restrict the scan to the format you are interested in with a correct value of SCAN_MODE.

这篇关于Zxing有时会从条形码中提取错误的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆