实时条码扫描器firebase

时间:2018-09-17 22:26:40

标签: barcode-scanner firebase-mlkit

大家好,这是我的第一个问题。 我在ML套件中的Firebase条形码扫描仪遇到问题。在文档中,没有关于实时条形码扫描仪的线索。我的意思是有图像的解决方案,但我想用相机即时完成而无需拍照。 Firebase条形码扫描仪是否仅可用于图像?这里有人对此有想法

1 个答案:

答案 0 :(得分:0)

You can absolutely pull it from the camera directly, either as part of a live preview or as an image returned from taking a picture with the camera. How you do that will depend on your platform. Be aware that dealing with a live preview will make your code significantly more complex, so I would recommend getting it working with pictures from the gallery first to make sure you can do what you want!

For iOS you would follow the instructions for the CMSampleBufferRef in the documentation, and you can see an example of using it in the quickstart sample.

For Android you'd take your preview data from a ByteBuffer as described in the documentation, and you can see a full sample app in the Android quickstart.

I'd recommend downloading and trying the appropriate quickstart sample in order to see the various moving parts you'll need to recreate in your own app.