Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

Barcode/QR code detection

2»

Answers

  • Options
    OptiLensoOptiLenso
    edited January 2017

    Hi,
    @KingPepito Thanks for the Code Sample
    I have one question. How did you manage to include the "ZXing"? When I try to install the package it says my .NET is just on 3.5 and I need 4.0 for ZXing. I also cannot change my .NET to a higher version. So how did you do it?

    Edit: @baskievits : sry I didn't see your post. But I think we have the same question.

  • Options

    Hi @OptiLenso, sorry for the late response,
    I used Zxing.net.mobile package, hope it will help

  • Options

    The example of Mike Taulty is not working for me unfortunately. I'm having problems with the Windows.Media.Capture.Frames namespace. I cannot import it. Is anyone else experiencing this problems?

  • Options

    @Roel
    yes I got the same problem and it is the same like before. The dll has to be framework 3.5 and not 4.x.
    @mtaulty How did you manage to import your QRCode Reader dll ?

  • Options

    I have been able to figure out what was not working for me. It appeared that I didn't choose Anniversary as target platform. When I updated my SDK version, I was able to do so.

    Now I'm experiencing another problem: when scanning one code and then another, the whole app crashes and I see in my output that I receive an Access Denied error.

  • Options

    I try to develop continuous scanning in my app. When using Mike's tutorial, I can only scan one time. When scanning a second time, the app crashes, with the following line:
    The program '[3200] Barcode Reader.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.

    Can someone please help me? Putting try .. catch around everything doesn't help.

  • Options

    Hi,

    I don't know that I did anything 'special' to reference the assemblies that I referenced in the blog post - I'll see if I can find the Unity project and will add it to the github repo if I can.

    Thanks,

    Mike

  • Options

    I am not familiar with the code Mike is using. But access violation indicates that you are trying to access memory that does not belong to your current process.

    It happens when you access (read or write) an address that is not mapped to any physical memory or is protected (tried to write to read-only memory, for example).

    https://goo.gl/GwYaGX

    Maybe try stepping through your code with the debugger and see where the error occur exactly.

  • Options

    I am not familiar with the code Mike is using. But access violation indicates that you are trying to access memory that does not belong to your current process.

    It happens when you access (read or write) an address that is not mapped to any physical memory or is protected (tried to write to read-only memory, for example).

    https://goo.gl/GwYaGX

    Maybe try stepping through your code with the debugger and see where the error occur exactly.

  • Options

    I use the code from @mtaulty 's blog too. I get the same error as @Roel when I try to scan a second qr code.

    If your machine has multiple graphics adapters, Unity may have created a WindowContext on the wrong adapter. If you experience a black screen when playing, please restart the Editor.
    The program '[5800] QRScanning.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.

    For my application it is necessary to scan more than one code. Should someone get a working solution to scan more qr codes please let me know.

  • Options

    The Plugins QR Code/Barcode Scanner and Generator have supported Windows Phone/WSA platform,Please Update from assetstore.> @avatar said:

    @Generalkidd did you try this plugin https://www.assetstore.unity3d.com/en/#!/content/56083 ? looks promissing
    @Anders could you add some clues how to use artoolkit marker detection in HoloLense?

    The Plugins QR Code/Barcode Scanner and Generator have supported Windows Phone/WSA platform Recently.Please see it in assetstore.

  • Options

    @elecV6 : This is quite possibly a Unity issue. Try Assets > Reimport All. Ive heard this fixing things before. MAKE SURE your DLLs are in place before re-importing. Unity will set everything back up for you.

  • Options

    Also, try this. I have created a scene in Unity that I used just for Barcode scanning. Once the scan has finished, I unload that scene and remove any unused assets. This "should" remove anything you had in memory and you would be able to reload the scene again additively for another single scan. its the only work around I have right now to do multiple scans in a row. If anyone comes up with something else, I am hopeful.

  • Options

    I am also having this crash problem on Hololens , can someone please help.

    thank you
    Dheeraj Singh

  • Options

    Same here: I did use Mike's approach, and tried several ZXing assemblies. However, they generated a file load exception when I started scanning.
    I've added the Unity and library code in github if anyone is willing to have a look at it.

  • Options

    Please see our thread here > https://forums.hololens.com/discussion/comment/13785#Comment_13785. It seemed to solve the issue. I will write up a blog post when I get a chance. I am not coming across any access violations and I am using ZXing.net

  • Options

    I managed to get some time to look at the code that's getting referenced here and I could reproduce the Access Violation which was happening down deep in Windows.Media.dll and relates to disposing a MediaFrameReader and a MediaCapture at the same time. I would find on HoloLens that this would crash every 2-3 scans. I could reproduce this on PC as well as HoloLens but less frequently.

    I've modified the code to try and workaround the issue as best I can as the crash is outside of my code.

    If people have success/failure with this, let me know and I'll take a look at it again.

  • Options

    @52cwalk said:
    The Plugins QR Code/Barcode Scanner and Generator have supported Windows Phone/WSA platform,Please Update from assetstore.> @avatar said:

    @Generalkidd did you try this plugin https://www.assetstore.unity3d.com/en/#!/content/56083 ? looks promissing
    @Anders could you add some clues how to use artoolkit marker detection in HoloLense?

    The Plugins QR Code/Barcode Scanner and Generator have supported Windows Phone/WSA platform Recently.Please see it in assetstore.

    I could not make it to work with HoloLens, could you help me please?

Sign In or Register to comment.