Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by 16bitjack · May 14, 2017 at 06:52 PM · cameramobileaugmented-reality

Xzing / Kudan AR Integration for QR reading

Hi,

I've been trying to get xzing to read barcodes from the android camera via [KudanAR][1], as far as I can tell everything I've done so far should work however it never manages to find a QR code within the image.

Any ideas on what I'm doing wrong?

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using ZXing; using ZXing.QrCode;

public class QR : MonoBehaviour { public Text QROutputText; Texture2D camTex; Color32[] camPix;

 void Update ()
 {
     try 
     {
         IBarcodeReader barcodeReader = new BarcodeReader ();

         camTex = SystemManager.instance._kudanTracker._trackerPlugin.GetTrackingTexture() as Texture2D;

         camPix = RotateMatrix(camTex.GetPixels32(), camTex.height);

         camTex.SetPixels32(camPix);

         var result = barcodeReader.Decode(camTex.GetPixels32(), camTex.width, camTex.height);

         if (result != null) 
         {
             QROutputText.text = "Scanned Text : " + result.Text;
             Debug.Log ("DECODED TEXT FROM QR:" + result.Text);
         }
         else
         {
             QROutputText.text = "No QR code detected";
             //Debug.Log ("NO BARDCODE DETECTED");
         }
     }
     catch (Exception ex) 
     { 
         Debug.LogWarning (ex.Message); 
     }
 }

 static Color32[] RotateMatrix(Color32[] matrix, int n) {
     Color32[] ret = new Color32[n * n];

     for (int i = 0; i < n; ++i) {
         for (int j = 0; j < n; ++j) {
             ret[i*n + j] = matrix[(n - j - 1) * n + i];
         }
     }

     return ret;
 }

}

Thanks [1]: https://www.kudan.eu/

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image micjahn · May 15, 2017 at 08:29 PM 0
Share

Can you provide a dump of the Color32 array from camTex.GetPixels32() which you use with the Decode method?

avatar image micjahn · May 16, 2017 at 06:19 PM 0
Share

Can you provide a dump of the Color32 array from camTex.GetPixels32() which you are using with the Decode method?

avatar image Slavrix · Oct 06, 2017 at 06:37 AM 0
Share

was this solved ? or did you find another method?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by micjahn · May 18, 2017 at 11:05 AM

Can you provide a dump of the Color32 array from camTex.GetPixels32() which you use with the Decode method?

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Slavrix · Oct 06, 2017 at 06:36 AM 0
Share

was this solved at all?

avatar image micjahn · Oct 06, 2017 at 03:55 PM 0
Share

I don't know. I never got an answer.

avatar image Slavrix micjahn · Oct 07, 2017 at 04:33 AM 0
Share

http://answers.unity3d.com/questions/1417221/reading-barcodes-and-qr-codes-using-kudan-with-zxi.html since the creator of this question seems to be awol, ive asked it again with my code block to try to get it to work, if you could take a look that would be awsome.

ill try and get a color32 dump, as i assume youll ask that again :D

avatar image micjahn Slavrix · Oct 09, 2017 at 06:44 PM 0
Share

of course, I would ask for it because I want to see what the BarcodeReader sees.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Cinemachine untouchable zone 1 Answer

Cinemachine On Mobile? 1 Answer

Rect or Camera transform? 0 Answers

How to set up a Videocamcorder as a Webcam in Unity? 0 Answers

Background camera doesn't render on mobile. 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges