Object Recognition – Diorama AR Tours

This piece was inspired by an assignment in another class.  In Cabinets of Wonder we were tasked with going to AMNH to go and see the dioramas and then make a diorama of our own.  I went for school but rushed through because I had already seen them twice before.  It was a pity.  We’d spoken in class about how outdated the dioramas (some are borderline racist) but it’s extremely expensive to change them or update them and they’re part of the permanent collection. I thought it could be interesting to toy with the idea of AR tours of permanent collections.  You could make numerous tours that approach the collection from a different angle. It would allow you to see the same thing over and over again but learn something new each time.  For this prototype I chose animals in mythology.  Below is an owl which in Greek mythology represented the Goddess of Wisdom, Athena.


For the purpose of this project I wanted to try out object scanning and recognition with Vuforia.  I had a lot of difficulty getting it to work, I rescanned objects tried it in different lighting but no matter what I did I couldn’t get it to recognize it in Unity.  After about 6 hours of redoing everything I realized that unlike Image Targets the max amount number you can have simultaneously is 2.  I had mine set at 3 and even though I was only looking at one object at a time the 3 there rendered everything obsolete.  After I figured that out I tackled adding sound.  It was something I’d tried to get before to work with the image markers but did not succeed. However this time I did, I need to copy some code from Vuforia and use their library.

using System.Collections;using System.Collections;using System.Collections.Generic;using UnityEngine;using Vuforia;

[RequireComponent(typeof(AudioSource))]public class ImageTargetPlayAudio : MonoBehaviour,
ITrackableEventHandler{ private TrackableBehaviour mTrackableBehaviour; public AudioClip mySound; public AudioSource mySource;
void Start() { AudioSource audio = GetComponent<AudioSource>();  mySource.clip = mySound; mTrackableBehaviour = GetComponent<TrackableBehaviour>(); if (mTrackableBehaviour) { mTrackableBehaviour.RegisterTrackableEventHandler(this); } }
public void OnTrackableStateChanged( TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus) { if (newStatus == TrackableBehaviour.Status.DETECTED || newStatus == TrackableBehaviour.Status.TRACKED || newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED) { // Play audio when target is found mySource.Play(); } else { // Stop audio when target is lost mySource.Stop(); } }}