Start a new topic
Solved

Switching targets?

Hi all,

What's the best approach to switching targets?


Imagine: a user can scan 5 different objects, eg beer cans. When the user scans CanOne then moves the camera to the next can: CanTwo, the app can recognise that the target has changed and a new action can be initiated.


I was thinking of using onExtendedTrackingQualityChanged and tracking if the quality of CanOne was totally lost, and therefore assume indicating that the target was lost, then re-initiate to scan for another can. But that seems like a messy workaround. 


Is there a specific function that can do this or shall I progress with onExtendedTrackingQualityChanged?


Thanks,

Lee 


Nevermind, found the simplest way to do it:


#n00b


    var pageOne = new AR.ImageTrackable(this.tracker, "*", 

    {

 

 // if the target is recognised

            onImageRecognized: function (target) 

 {

 



               // do stuff here

                alert("image recognised");

            },

 

            onError: function (errorMessage) {

                alert(errorMessage);

            },

 

 // if the target is lost

            onImageLost: function (target) 

 {

              // do stuff here

              alert("image lost");

  },

 

 

        });

Hi,


If you work with image recognition then please check the sample 'Different Images' from the sample app and the respective documentation.


That shows you how to work with different images that should be recognizable.


Thx and greetings

Nicola

Login or Signup to post a comment