Search Unity

How to do the BarCode Scanning through Hololens

Discussion in 'VR' started by schetty, Feb 15, 2018.

  1. schetty

    schetty

    Joined:
    Jul 23, 2012
    Posts:
    424
    Hi All,

    Can anyone please help me out how to scan the Barcode using Hololens?
    I have got a reference for a Qr-code scanning but i haven't seen anyone to implement the BarCode scanning using the Hololens.
    I tried to do with the ZXing reference but not finding much reference or tutorial, so i get some help it would be really great.

    Is it really possible to do BarCode Scanning through Hololens?

    Thanks.
     
    Last edited: Feb 15, 2018
  2. Shubham_16

    Shubham_16

    Joined:
    Sep 19, 2016
    Posts:
    33
    If you are using Unity + C#, we need to get zxing c# wrapper & import into ur project.
    You need to copy the image feed you get in hololens & feed it to xzing library.

    Code (CSharp):
    1.          
    2.             WebCamDevice[] oCameras = WebCamTexture.devices;
    3.             oCamera = new WebCamTexture(oCameras[0].name);
    4.             oCamera.Play();
    5.             oImageBufferColor32 = new Color32[oCamera.width * m_oCamera.height];
    6.             oImageBufferBytes = new byte[oImageBufferColor32.Length * 3];
    7. // You need it to pass this data to appropriate Zxing API.
    8.  
    Yes, it's possible & and we have done it.

    https://jeremylindsayni.wordpress.c...-create-barcode-images-using-c-and-zxing-net/