Start a new topic

Debugging image recognition on android phonegap app

Debugging image recognition on android phonegap app


I've made an android application using the phonegap extension and I'm trying to get the image recognition to work.

I've set up the project as described here -

I've set the permissions in the AndroidManifest.xml as described here -

I've created and downloaded my target collection as described here - (The image I used got 2 stars)

I've tested the code in my desktop browser using ADE and the JavaScript seems ok

When constructing the AR.Trackable2DObject, I'm using the target name I entered when creating the target collection

When testing on the device the wikitude AR view starts (I can see the camera view) and my target collection does get loaded (the onLoaded callback I pass in when constructing the AR.Tracker is called, and the onError callback isn't) BUT, I haven't been able to get any overlays to appear.

I don't know what else I can try to work out what might be going wrong. Has anyone got any advice for how I can debug this, or can think of anything else I might have missed?

If it's useful, here's my JavaScript...

this.tracker = new AR.Tracker("res/", {
onLoaded: function() {
document.getElementById('loadingMessage').innerHTML = "Loading...Success!";
onError: function() {
document.getElementById('loadingMessage').innerHTML = "Loading...Error!";

var image = new AR.ImageResource("res/overlay.png");
var overlay = new AR.ImageDrawable(image, 1.0);

var trackable2DObject = new AR.Trackable2DObject(this.tracker, "marker", {drawables: {cam: overlay}});


Cheers, Ian.


I think it was just down to the image I was using for the target. It works fine with a different target. The original image I was using got a 2 star rating and actually worked fine with the earlier version of wikitude (with the vuforia libraries).

I'll just continue with the different target. I can upload the original one if anyone wants to look into why it was given a 2 star rating, or why it worked with the earlier version of wikitude and not now. Let me know if this will be of any use.
Login or Signup to post a comment