android zxing 默认编码,ZXing在Android上 – 解码性能极其缓慢
正如标题所示,我正在尝试使用ZXing的Barcode Scanner应用程序在Android设备上解码QR码.我已经在互联网上阅读了多个关于如何不鼓励将应用程序集成到自己的项目中的线程.相反,应该使用IntentIntegrator.但是,在我的情况下,这不是一个选项.下面是我要为每个相机框架调用的代码片段.LuminanceSource source = new RGBLuminanceSou
正如标题所示,我正在尝试使用ZXing的Barcode Scanner应用程序在
Android设备上解码QR码.我已经在互联网上阅读了多个关于如何不鼓励将应用程序集成到自己的项目中的线程.相反,应该使用IntentIntegrator.
但是,在我的情况下,这不是一个选项.下面是我要为每个相机框架调用的代码片段.
LuminanceSource source = new RGBLuminanceSource(bitmap);
BinaryBitmap bm = new BinaryBitmap(new HybridBinarizer(source));
try {
Result result = reader.decode(bm); // This line takes approx. 6seconds
if (!result.getText().isEmpty()) {
Log.e("MYTAG", "Found something: "+result.getText());
}
}
catch (NotFoundException e) {
e.printStackTrace();
} catch (ChecksumException e) {
e.printStackTrace();
} catch (FormatException e) {
e.printStackTrace();
}
正如我所说,这个过程非常缓慢.解码需要5到8秒之间的任何时间.
我尝试过使用MultiFormatReader和QRCodeReader.
任何人都可以对这个问题有所了解吗?
更多推荐



所有评论(0)