Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Vuforia Cloud Recognition Show 3D object from your cloud target upon detection

Discussion in 'Vuforia' started by boang3000, Jan 9, 2018.

  1. boang3000

    boang3000

    Joined:
    Jan 8, 2018
    Posts:
    9
    Hi,

    I am a newbie in this Vuforia Unity3d and C# but get to learn the basic functionality. I followed the instruction from this page (https://library.vuforia.com/articles/Solution/How-To-Implement-Cloud-Reco.html) and it seems it is now working well when scanning and I get the result of retrieving the metadata of each object. However, I tried adding an object when on the image to show it when it is detected by the application but it is not working.

    I already tried following their instruction from their example on the link provided but got no luck. Does someone know how or can explain or teach me how to make it work?

    I am using the latest Vuforia and Unity3d by the way.
     
    Last edited: Jan 24, 2018
  2. boang3000

    boang3000

    Joined:
    Jan 8, 2018
    Posts:
    9
    Has anyone done this?
     
  3. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    I'd recommend checking out our Core Samples on the asset store to get an example of Cloud Reco working. Also, be aware that there is a known issue with Cloud Reco in playmode. It is recommended you deploy to device at the current time.
     
  4. boang3000

    boang3000

    Joined:
    Jan 8, 2018
    Posts:
    9
    @Vuforia-Strasza Yeap I have tried running on the device on your Core samples and it is working fine.

    I've tried changing the Access Keys to my own access key with 5 stars on the database, I use a rock image based on the screenshot (capture2.png). You can check the Screenshot provided (capture.png), I have added on the `CloudContentManager` a new content so that It can detect my own 3d object, added `Augmentation Objects size` into 5 and I expect that If I run this on my device, it will detect and show the details and the 3d object but the result is just showing the details of the image and no 3d object is showing. What am I missing here?
     

    Attached Files:

  5. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    @boang3000 I see that your width is set to 300. What unit of measurement are you intending this to be and how large is your printed target? Could you share the original image file you've uploaded with me?
     
  6. boang3000

    boang3000

    Joined:
    Jan 8, 2018
    Posts:
    9
    @Vuforia-Strasza does it need to be large? Actually, I just added 300 for the width because I think the size or width won't matter, does it matter? The full size of an image is in the attachment.

    Is there any problem with my previous post or am I missing something? I am so stuck with displaying when detected on the device. Need help, please :(
     

    Attached Files:

    • rock.jpg
      rock.jpg
      File size:
      143.2 KB
      Views:
      1,529
  7. boang3000

    boang3000

    Joined:
    Jan 8, 2018
    Posts:
    9
  8. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    The width does matter. It should match the size of the physical target you are detecting against. I was able to detect your target with the width set to a smaller value that more closely matched the version of the target you sent above.

    Thanks
     
  9. boang3000

    boang3000

    Joined:
    Jan 8, 2018
    Posts:
    9
    Yes, I was able to detect it too but my main concern is when detecting the image it should show an object model that I provided which is in your tutorial (https://library.vuforia.com/articles/Solution/How-To-Implement-Cloud-Reco.html) but it is not showing.
     
  10. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Did you add code that will display a model upon detection? Our core samples have an example of doing this if you need a reference.
     
  11. dunkelkaiser86

    dunkelkaiser86

    Joined:
    Nov 9, 2016
    Posts:
    1
  12. unity_xrPBQ-2zcfd-DA

    unity_xrPBQ-2zcfd-DA

    Joined:
    Jun 15, 2018
    Posts:
    19
    Hey my problem is not related to this much but I am also having an issue with cloud reco sample I am trying to play audio whenever cloud targets get detected. Say I have uploaded images on vuforia cloud of numbers say 1,2 and 3 and whenever the number get detected it should play respective audio to that number. So for that, I am checking in local for particular audio for the number that is detected using this code.

    public IEnumerator loadAudio(string name)
    {
    Debug.Log("In load audio");
    url = Application.persistentDataPath + "/" + name + ".mp3";
    using (var www = new WWW("file://" + url))
    {
    Debug.Log("in here");
    yield return null;
    if (www != null && www.isDone)
    {
    this.audioSource.clip = www.GetAudioClip(false, true) as AudioClip;
    this.audioSource.loop = false;
    this.audioSource.Play();
    }
    else
    {
    Debug.Log("Unable to locate song.");
    }
    Debug.Log("Before clip " + Application.persistentDataPath);
    audioSource.clip = www.GetAudioClip(true, true);
    audioSource.Play();

    But as soon as this method gets called unity editor get stuck then I have to forcefully close the editor through task manager.

    I have tried with playing preloaded audio i.e. audio assigned to the audio source during build time it plays without an issue so I guess the problem is how I am loading the audio from local storage. But this same code works with device database instead of cloud database. So if anyone can help me with this that would be very helpful.

    Thanks.