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

Demo的二维码图片识别, 一直返回null #197

Closed
harryhasai opened this issue Jul 25, 2022 · 5 comments
Closed

Demo的二维码图片识别, 一直返回null #197

harryhasai opened this issue Jul 25, 2022 · 5 comments

Comments

@harryhasai
Copy link

image
image
图片二的方法中不停的throw NotFoundException
我的手机是Vivo x50, Android10系统 二维码图片是
111
请问一下是什么情况...

@jenly1314
Copy link
Owner

你这个二维码刚测试过了,用 Demo 扫码识别很快的

@harryhasai
Copy link
Author

如果直接扫, 我这边应该是和你刚才测试的一样, 很快.
这个图片我是保存到相册里, 然后从相册选择图片来识别, 然后就是走我截图的两个方法, 结果一直是在抛异常, 最后result返回的是null

@harryhasai
Copy link
Author

你另外一个MLKIt这个库到是可以正常识别...但是目前我这边使用当前库已经写了一大波逻辑了, 包括自定义页面也写了好多, 实在不想在更换了, 所以想请问一下 还有啥解决办法没

@jenly1314
Copy link
Owner

jenly1314 commented Jul 25, 2022

如果直接扫, 我这边应该是和你刚才测试的一样, 很快. 这个图片我是保存到相册里, 然后从相册选择图片来识别, 然后就是走我截图的两个方法, 结果一直是在抛异常, 最后result返回的是null

相册选择图片识别的话,基本算是直接走的 zxing 识别,如你截图中的代码所示,如果识别失败,也只是换一个二值化的实现去尝试再识别一次而已。据我所知,这个识别率与图片大小和二维码在图片中的占比有很大的因素; 看你这个二维码很清晰,可能是占比问题,建议你二维码周围多留点边距试试。还有一点,切记识别的图片不要太大。建议图片大小在 500 * 500 以内。

@harryhasai
Copy link
Author

刚试了MLKit,,, 目前是所需功能都有, 顺便问一下大佬, 看你mlkit的库,没发现有创建二维码的功能, 所以想问一下大佬是否有这个功能呢

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