我正在尝试用于安卓系统的google_ml_kit flutter软件包,以便从驾照条形码中获取信息。
我正在使用mlkit中的示例应用程序对其进行测试:https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/example
返回扫描条形码列表的代码如下:
final barcodes = await barcodeScanner.processImage(inputImage);
我扫描了我的驾照条形码,但条形码总是被识别为BarcodeType.Text而不是BarcodeType.driverLicense。
现在我知道这个包中确实存在BarcodeDriverLicense:https://pub.dev/documentation/google_ml_kit/latest/google_ml_kit/BarcodeDriverLicense-class.html
我不知道如何使扫描的条形码被识别为驾照条形码。
我是不是漏掉了什么步骤?
谢谢
发布于 2021-08-25 21:49:09
我在上面的评论中发布了我的详细答案。简而言之,解决方案是将CameraController的ResolutionPreset设置为最低限度的ResolutionPreset.medium。
希望这对其他人有帮助。
编辑只需阅读这篇文章,就能更好地理解为什么PDF417扫描需要更高的分辨率。https://developers.google.com/ml-kit/vision/barcode-scanning/android
https://stackoverflow.com/questions/68899203
复制相似问题