Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

比较复杂的二维码,多扫几次会有扫出数字的问题,图中扫了三次,两次是正常的 #196

Closed
jiangsai opened this issue Jul 1, 2022 · 2 comments

Comments

@jiangsai
Copy link

jiangsai commented Jul 1, 2022

image
image

@jiangsai
Copy link
Author

jiangsai commented Jul 1, 2022

demo也会出现这个问题

@jenly1314
Copy link
Owner

这种是 zxing 本身的问题;不过你可以通过配置扫码支持 识别的条形码/二维码 来降低这种问题的出现概率。

比如只有识别二维码的需求时,可以参照下面的配置:

        //初始化解码配置
        DecodeConfig decodeConfig = new DecodeConfig();
        decodeConfig.setHints(DecodeFormatManager.QR_CODE_HINTS)//如果只有识别二维码的需求,这样设置效率会更高,不设置默认为DecodeFormatManager.DEFAULT_HINTS

        //在启动预览之前,设置分析器,只识别二维码
        getCameraScan()
                .setAnalyzer(new MultiFormatAnalyzer(decodeConfig));//设置分析器,如果内置实现的一些分析器不满足您的需求,你也可以自定义去实现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants