Android Question Has anyone used Camera2 / CameraEx2 for Barcode scanning?

Discussion in 'Android Questions' started by Ian Garton, Jul 25, 2019.

  1. Ian Garton

    Ian Garton Member Licensed User

    Hello. I know the camera library and CameraEx class can be used to access the Google Vision barcode scanning, however has anyone done this with the Camera2 library?

    I'm having issues with particular Samsung devices not detecting barcodes with the camera library, and want to check with camera2.
  2. Erel

    Erel Administrator Staff Member Licensed User

    Google Vision isn't directly related to the camera. It receives an image and analyzes it.

    The relevant code is:
    frameBuilder.RunMethod("setImageData"Array(bb, cs.Width, cs.Height,  842094169))
    The three supported formats are NV16 (16), NV21 (17) and YV12 (842094169).
    Maybe your camera returns a different preview format. Try it with the two other values.
    Ian Garton likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice