mattrayner / cordova-plugin-vuforia

A 'simple' Vuforia based image recognition plugin for Cordova
MIT License
59 stars 39 forks source link

We should be able to update the images Vuforia is searching for on the fly #79

Closed mattrayner closed 8 years ago

mattrayner commented 8 years ago

Expected Behavior

Once you've launched the Vuforia plugin, we should be able to update the array of images we are searching for, without closing the camera. ​

Current Behavior

Once you've launched the plugin, that's it... The image you've specified are the ones you are searching for. ​

Possible Solution

Add the ability to change the list of images you are searching for.

Context

If you are creating an application and you'd like to search for images in a certain order, at the moment you have to tell Vuforia about all of your images in one go i.e.

[ 'clock-tower', 'fountain-pen', 'notebook' ]

Then inside of your javascript, you've got to write code like:

var imagesRecognised = 0,
    targets = [ 'clock-tower', 'fountain-pen', 'notebook' ];

if( data.imageName == targets[imagesRecognised] ){
  // We've recognised the expected image
  imagesRecognised++; //check for the next one

  // DO SOMETHING
}

Imagine now, that instead of matching just clock-tower, you want to match clock-tower, or fountain-pen, then depending on that match, match a different set, and a different set etc etc.

It would be far easier to be able to update the array of images we are searching for on the fly. Then we can let Vuforia do what it's really food at... Match images..

mattrayner commented 8 years ago

@dsgriffin - should this be in 3 or 3.1?