HI, All
Barcode detector uses ImageData from camera's _Preview (data() As Byte) event:
But if to try to use Camera2 lib - only the preview bitmap can be used:
But recognition does not work with such way. No errors, just nothing among barcodes is recognized.
Example to try.
Any suggestion ?
Barcode detector uses ImageData from camera's _Preview (data() As Byte) event:
B4X:
Dim bb As JavaObject
bb = bb.InitializeStatic("java.nio.ByteBuffer").RunMethod("wrap", Array(data))
frameBuilder.InitializeNewInstance("com/google/android/gms/vision/Frame.Builder".Replace("/", "."), Null)
Dim cs As CameraSize = camEx.GetPreviewSize
frameBuilder.RunMethod("setImageData", Array(bb, cs.Width, cs.Height, 842094169))
But if to try to use Camera2 lib - only the preview bitmap can be used:
B4X:
Dim cs As CameraSize = cam.PreviewSize
LastCadr = cam.GetPreviewBitmap(cs.Width, cs.Height)
Dim frameBuilder As JavaObject
frameBuilder.InitializeNewInstance("com/google/android/gms/vision/Frame.Builder".Replace("/", "."), Null)
frameBuilder.RunMethod("setBitmap", Array(LastCadr))
But recognition does not work with such way. No errors, just nothing among barcodes is recognized.
Example to try.
Any suggestion ?